(CNN) -- Calling him "arrogant and defiant," a Wayne County Circuit Judge on Tuesday sentenced former Detroit Mayor Kwame Kilpatrick to four months in jail with no early release under the terms of a plea deal.

Former Detroit Mayor Kwame Kilpatrick listens as he is sentenced Tuesday in Wayne County, Michigan.

Kilpatrick pleaded guilty last month to two felony obstruction of justice charges stemming from his efforts to cover up an extramarital affair. He also pleaded no contest to charges of assaulting a police officer attempting to serve a subpoena on a Kilpatrick friend in that case.

In imposing the sentence, Judge David Groner harshly criticized Kilpatrick for his conduct, particularly for a televised speech that aired hours after he entered his pleas.

"That night, the community expected to hear a message of humility, remorse and apology," Groner said. "Instead, we heard an arrogant and defiant man who accused the governor, among others, for his downfall." Watch the judge issue the sentence »

While a presentencing report submitted to the court said Kilpatrick accepts responsibility for his actions, Groner said he questioned the former mayor's sincerity.

"Many defendants have stood before this court. However, this case is different, and you are not the typical defendant," the judge said. "... You were expected to lead from the front and set an example."

Kilpatrick was accused of blocking a criminal investigation into his office and firing a police deputy to cover up an affair with his then-chief of staff, Christine Beatty. When that deputy, Gary Brown, filed a whistle-blower suit last summer, Kilpatrick and Beatty denied under oath that an affair had taken place.

Groner noted that after a jury found in Brown's favor, Kilpatrick publicly vowed to appeal, only to do a "180-degree" turn after he found out the plaintiffs were in possession of text messages that gave evidence of the affair. Brown then urged the City Council to approve settlements, which cost the city $8.4 million -- closer to $9 million after legal costs.

In January, the Detroit Free Press revealed the text messages that contradicted Kilpatrick's and Beatty's testimony.

After the text messages were made public, Wayne County Prosecutor Kym Worthy charged Kilpatrick and Beatty with multiple counts of perjury, obstruction of justice and misconduct in office. The most serious charges would have carried a maximum penalty of 15 years in prison upon conviction.

Beatty resigned her post after the text messages were made public, but the case against her remains pending, Worthy said. The Free Press reported Beatty has rejected several plea deal offers, the last of which would have required her to serve 150 days in jail.

Worthy told reporters after Kilpatrick's hearing that she was satisfied with the result, but could not comment extensively on Kilpatrick's case. "We have another defendant to try," she said. "I don't want to step over that line."

Kilpatrick must also pay the city of Detroit $1 million in restitution, Groner ordered, and forfeit any future pension.

He initially refused to resign, and Michigan Gov. Jennifer Granholm had called a hearing on whether she should remove him from office at the request of the Detroit City Council. Granholm adjourned those hearings after Kilpatrick pleaded guilty and agreed to resign.

In the speech after he pleaded guilty September 4, Kilpatrick told reporters Granholm and city officials should work for the people of Detroit as hard as they did to get him out of office.

He told the crowd his marriage is better than ever, and kissed his wife to resounding applause when he concluded his remarks. He said he decided to step down so the city could move forward.

Groner also ordered Kilpatrick to sign an order of revocation regarding his law license. Because of a pending complaint against Kilpatrick, he could not surrender the license, but instead had to agree to revocation -- something his defense attorneys argued vehemently against. Groner told them the issue could be raised on appeal if necessary.

The judge did, however, deny prosecutors' request that Kilpatrick repay $22,000 in costs unique to prosecuting his case -- including the purchase of new door locks for their offices.

He also refused a prosecution request to order that Kilpatrick attend anger management counseling based on the July 24 incident involving the police officers, saying it was "an isolated incident" and he knows of no other evidence that Kilpatrick is violent or requires counseling.

Worthy said she was disappointed with that decision, but acknowledged, "It is unusual to ask for prosecutors' costs. ... A lot of judges aren't familiar with that."

On the law license, she said, "Frankly, I'm surprised we were even having that discussion," adding that defense attorneys, prosecutors and "everybody was clear that the license should be given up. He should not practice law."

Groner imposed the sentence at the end of a lengthy hearing featuring remarks from a phalanx of prosecutors and defense attorneys. The judge grew impatient with members of Kilpatrick's defense team, most of whom made extended remarks.

The hearing itself began more than a half hour late, as attorneys met to discuss terms of Kilpatrick's plea bargain, according to the Detroit News. And the imposition of the sentence was punctuated by two court recesses as attorneys wrangled over conditions.

During the hearing, Kilpatrick's defense attorneys pleaded with Groner to keep in mind the benefits he had brought to the city as mayor. But prosecutors read statements from both police officers involved in the incident, saying they had suffered lasting effects from it.