A judge in the legal action that former Miami anchorman Charles Perez says cost him his job has granted the newsman a two-year restraining order against his former partner, the Miami Herald reported.

Openly gay Perez anchored ABC affiliate WPLG's channel 10 newscast until he accused his employer of discrimination in a complaint filed with Miami-Dade's Equal Opportunity Board on July 31.

But Perez's story of being fired because he is gay starts with Dennis Ricardo Pena, the ex-partner now ordered to stay at least 500 feet from Perez.

Perez, 46, testified that he was afraid of Pena, a 42-year-old unemployed paralegal, claiming his ex had threatened him physical harm, sexually assaulted him, and promised to ruin his professional career.

It was those juicy bits of headline fodder that Perez says prompted his termination after Miami Herald columnist Joan Fleischman reported the domestic violence complaint.

“[Executives] don't want to do anything that would make an advertiser see you as less family friendly,” Perez told gay weekly Edge Boston. “Though they will never say 'We need to get rid of the gay guy,' they will say 'We need to go a different direction here.'”

Station executives demoted Perez to weekend anchor/street reporter soon after his troubles surfaced. Perez fired back with his discriminatory complaint; days later he was fired.

“WPLG is disappointed that the actions of Charles Perez left us no real choice other than to terminate his employment contract,” WPLG Vice President and General Manager Dave Boylan said in a statement. “WPLG emphatically denies Perez's claim of discrimination. The document he is circulating is filled with misstatements and untruths.”

The demotion, station executives say, was a cost-cutting effort, a claim Perez says is nonsense because the station is contractually obligated to pay him a full salary for the remainder of his contract.

“The reasons they've given me were financial, but I've tried to calculate it and there's no way it makes sense. They are giving the lines their attorneys have written for them,” Perez said. “We are the number one newscast in the market, regardless of time of week, so why mess with what works? It didn't make sense, financially or rating-wise.”

Perez and Pena began dating in New York, while the anchor was working at WABC, in February of 2006. The pair moved to Miami in 2006 but had separated by August 2008. Judge Rosa Figarola awarded a jointly-owned Miami Beach condo the men had fought over to Perez. The property, which Perez said he would give “back to the bank,” has a negative equity of $141,000.

Pena said he would appeal the ruling.