ROCKLAND, Maine — City Attorney Kevin Beal, whose ouster had been sought by the city manager, submitted his resignation on Monday.

Beal will remain with the city through Sept. 30.

The announcement by the City Council came immediately after the public comment session of the council’s meeting Monday evening at which several speakers praised Beal’s work and urged councilors to retain the full-time staff attorney in the 2016-2017 budget.

In his resignation letter, dated Monday, Beal said he wants to return to Portland. He praised Rockland and its citizens in the letter.

“Rockland is a great community, with committed and interested public servants, volunteers, and business and community leaders,” Beal stated. “It has been my good fortune to have formed many important and, I hope, lasting ties with the community. I wish the city all the best in its future efforts to address the challenges of serving as the Midcoast’s premier economic, cultural and social center.”

The separation agreement reached with Beal calls for him to be paid through Dec. 30.

The resignation came as the council wrestled with whether to retain the full-time position. The announcement also came three weeks after City Manager James Chaousis renewed his call for the council to terminate Beal’s contract.

Councilors voted Monday evening to accept Beal’s resignation. Councilor Valli Geiger choked back tears in praising Beal.

“Kevin is an excellent public servant who would go to the ends of the Earth to help the city,” Geiger said.

Chaousis had claimed in a letter to the council that Beal had demonstrated insubordination and participated in unethical and illegal activities, although he had not specified what those activities were. Last week, Chaousis submitted his resignation and the council voted Monday night to accept his resignation effective Thursday.

Geiger said comments made about Beal were close to slander and she was sorry for the statements.

Beal was hired in September 2007.

Neither Beal nor Chaousis were at the Monday evening budget meeting.

The council had been set to give final approval to the budget Monday night but postponed a final vote until Wednesday, July 6. Geiger said she wanted to meet with the wastewater treatment plant director before a final vote.