Westbrook’s business and community relations chief is leaving to join a local company as a lawyer and consultant.

William Baker, who previously served as the city’s police chief, would not name the company he is joining. His last day on his current job will be May 6.

Mayor Colleen Hilton called a news conference Wednesday to make the announcement and invited city staff and members of the business community to talk about the effect Baker has had on the city.

Baker is credited with attracting businesses and starting new events in Westbrook, from the city’s first brewery to the Tough Mudder obstacle course.

His tenure, however, hasn’t been without controversy. Baker made fun of several residents in a profane rant sent in an email to the mayor last year that became public through a Freedom of Access request. He later apologized and was sent to sensitivity training.

Baker started his law enforcement career as a patrolman in Cumberland and later served as a chief and public safety commissioner in Massachusetts, where he also earned a law degree. He was Westbrook’s police chief from 2007 to 2011.

At times, he also oversaw the city’s fire department as it dealt with harassment issues and turnover in leadership.

He briefly left the city to take a job with a firm that works as a contractor with the FBI, but in 2012 was hired back by the city as its director of business and community relations and assistant city administrator, a new position that replaced the economic development director.

Several members of the community spoke Wednesday, saying how Baker had helped them as co-workers, business owners and friends.

Rob Mitchell, who has worked with Baker to revitalize the Presumpscot River, said he turned to Baker when he decided to construct a building that would overlook it.

“My building’s full because of him,” Mitchell said.

Kathie Dioli, owner of specialty foods maker Schlotterbeck & Foss, said she never thought to move her business from Portland to Westbrook until Baker convinced her it was a good idea. Largely because of help he’s provided, it’s lived up to his promise.

“He’s somebody that will be there for you all the time,” she said.