
"Real Housewives of O.C." star Gretchen Rossi's ongoing defamation suit against her ex-BF just BACKFIRED royally,TMZ has learned, after a judge ruled SHE has to pay HIS lawyer fees.

According to documents filed in Orange County Superior Court -- the judge ordered Rossi to fork over $40,799.38 in attorney's fees for ex boyfriend Jay Photoglou ... after several of the claims she made in her lawsuit were dismissed.
As we previously reported -- Rossi and Photoglou have been embroiled in a protracted court battle ... after she sued him for defamation, claiming he trashed her in the media.
Jay's attorney, Bryan Freedman, tells us Gretchen has until next week to pay up ... or else.
See also

Gretchen Rossi's Ex -- Pay For My Damn Parking!

Housewife vs. Housewife: Who'd You Rather?

'Real Housewife' Gets Millions from Dead Fiance
ncG1vNJzZmivp6x7tbnZZ5qopV9nfXJ9jmlraGlhZLSzsdOcn56mXae8tL%2FIZqmemZxitbDB0p6uoq6VqHqwsoyoqZqml5p6pLvUp6uyZZqWxm68x6irqJ%2BcpMJusMSfmKaZpJ68r3nCqKyrrF2WwbW70aecsmc%3D