An enraged Mayor Eddie A. Perez, according to testimony in his corruption trial Thursday, dropped an F-bomb on the public works director when he found out that officials were trying to oust contractor Carlos Costa from the troubled Park Street restoration project.

The question is how the jury will interpret the mayor's reaction, keeping in mind that it was the $40,000 in deeply discounted work that Costa performed on the mayor's house that led to a bribery case against Perez.

Was the mayor angry because officials were messing with his friend Costa? Or was he angry that the officials might be blundering into a costly lawsuit that would further delay a construction project that had Park Street merchants up in arms?

Former Public Works Director Bhupen Patel testified that the mayor summoned him after Patel's second-in-command had written to Costa's insurance-bond company in May 2006 saying that Costa was in default of his multimillion-dollar Park Street contract, and for the company to consider options that included pulling Costa's performance bond.

But Costa wrote a letter of his own to the city, saying that he would sue if the request wasn't withdrawn, and contending that the city was just trying to force him to drop his claims for hundreds of thousands of dollars in additional payments for the Park Street work, which had been beset by delays and problems with workmanship.

"I got a call saying the mayor wanted to see me," Patel told prosecutor Michael Gailor. "I came in and the mayor stood up and said, 'What the [expletive] is going on here?' He was angry. He was holding a copy of the letter from Carlos."

Patel said that Charles Crocini, the mayor's director of capital projects who was there with Perez and Patel, said to the mayor at that point, "Don't worry; we'll take of it. We'll let the bonding company know it was only a warning."

About a week later, Crocini wrote a letter to the bond company, countermanding the earlier request for action against Costa. Costa remained on the job, which was finished 2½ years late.

Patel also testified that Perez told him previously to compromise with Costa and pay him 50 percent of the extra payments that he was demanding, even though Patel's staff had determined that most of the claims were groundless. Patel also said that Costa was sending his claims and other correspondence from the Park Street job directly to Perez's office, which wasn't the way the process was supposed to work.

It is the prosecution's position that Perez kept Costa on the Park Street project as a favor to a friend even though the project was a costly disaster, and that the mayor received a benefit in return.

But under questioning from defense lawyer Hubert Santos, Patel admitted that in his testimony to the grand jury investigating corruption in Hartford's city hall, he never mentioned that the mayor had used an expletive.

Patel also admitted that he told the grand jury that he eventually agreed that Costa should remain on the job because it was the least costly option.

"The mayor gets a letter from Costa saying he's going to sue," said Santos. "And he's shaking it when you come in. He wants to know what's going on. He's irritated, because now we're talking about a further threat of litigation by Costa, right?"

"That's probably true," said Patel, who stepped down at Perez's request in 2006 and retired.

Patel also acknowledged that neither he nor his staff at public works knew the legal maneuvers involved in firing a contractor and having his performance bond pulled.

"You have to terminate the contractor before the bond can be pulled, right?" asked Santos.

"I don't know," said Patel, who had worked for the city for 28 years.

The prosecution alleges that in 2005, while the Park Street project was underway, Costa performed the $40,000 worth of home improvements on Perez's house. The mayor, a Democrat who is serving his third term in office, paid $20,000 for the work nearly two years after it was completed, immediately following his initial questioning by investigators in 2007. In that interview, the state contends, Perez told the investigators that he had already paid for the work.

Perez also is charged with criminal attempt to commit first-degree larceny by extortion and coercion for allegedly letting political power broker Abraham Giles keep lucrative parking-lot deals without valid city contracts. In return, the warrant says, Giles, a former Perez adversary, threw his political weight behind the mayor.

Visit courant.com/perezcharges for more coverage of the case, including photos, video and legal documents.