Tuesday’s Costa Mesa City Council meeting ended not with a bang but with an explosion of anger and bewilderment as council members stunningly booted Katrina Foley from her appointed role as mayor in favor of council colleague Sandy Genis.

In front of a shocked crowd that filled City Hall until past 1 a.m. Wednesday, the council voted 3-2 — with Foley and Councilman John Stephens opposed — to elevate Genis to mayor.

Council members split along the same lines in naming Councilman Allan Mansoor to replace Genis as mayor pro tem.

That Mansoor and his ally, Councilman Jim Righeimer, would support supplanting Foley came as little surprise. They have clashed regularly with her on the dais.

The jaw-dropper, though, was Genis’ vote, since she has previously supported Foley’s political campaigns and received her endorsement in return.

Shouts of “Boo!” and “Traitor!” rang out from Foley’s supporters as Genis voted to remove her as mayor.

For about an hour and a half before that, a steady stream of residents offered almost universal praise for Foley, characterizing her as a strong and effective leader who has always represented Costa Mesa well.

Some supporters had signs reading “We support Mayor Foley” and “Remember … we vote in 2018 & 2020.”

Katrina Foley, pictured in July, was replaced as Costa Mesa mayor early Wednesday. She said after the City Council’s vote that she “can’t even express my disappointment.” (File Photo )

“I can’t even express my disappointment,” Foley said after the vote. “My family walked precincts for Mayor Pro Tem Genis, my children walked neighborhood by neighborhood … I walked. I invested my personal funds to support her … I wanted us to work together as a team and I have done everything in my power to outreach to her to try to make sure I’m addressing her concerns. There really was nothing else I could do.”

Stephens, who also campaigned with Genis, said he felt “betrayed” by her actions and believes the move violates the city’s municipal code, which he said specifies that mayors serve two-year terms. The council appointed Foley as mayor last December. She has been on the council since 2014 and also was elected to the panel in 2004 and 2008.

While the code spells out that the mayor will serve a two-year term starting in 2018 — when local voters for the first time will be able to cast ballots specifically for that position — City Attorney Tom Duarte said his initial opinion is that the council could act in the interim to replace an appointed mayor.

Stephens, a business litigation attorney, responded: “I disagree with that. That’s wrong.”

Stephens said Wednesday afternoon that he is considering contesting the decision but hasn’t decided yet and isn’t sure what form the challenge might take.

In an interview after the meeting, Genis said the move to replace Foley “was not, by any means, an easy decision” and has “been building for a while.”

“She excels at certain things and is very bright, does her homework, so I can’t fault her on any of that,” Genis said. “So I think that she still has a tremendous amount to offer.”

Genis, who has been on the council since 2012 and also served from 1988 to 1996, said she felt there were times Foley disregarded the council’s consensus on how to conduct certain business — such as in the process earlier this year to appoint new members to the city’s planning, senior and parks and recreation commissions.

“Of course, that was like my monumental screw-up,” Genis said, referring to an error she made in voting for her chosen commission candidates. “But at the same time, there was also a very blatant disregard for the procedure that we’d all agreed upon.”

Another concern, she said, “is if it’s OK for ‘our side’ to blow off things, then you can’t complain when somebody else does it.”

“I think you need to hold everybody to the same standards and the same accountability,” Genis said. “Which means, boy, am I in for it.”

Reshuffling the council, Foley’s supporters contended, was a petty political stunt engineered by Righeimer, who put the item on Tuesday’s agenda.

After the meeting, Righeimer was noncommittal about his reasons for pushing to reorganize the council’s leadership.

He did, however, call for an investigation into Foley’s activities as mayor.

“There are situations that the mayor has gotten herself into that are going to cause a lot of problems for the city,” he said, declining to elaborate.

Righeimer also dismissed criticism that he was playing politics, saying he’s “not running for office.” He will be termed out of his council seat in 2018.

Mansoor said he and Genis disagree on several issues but that he appreciates that she is friendly, fair and respectful to everyone.

“Those are qualities I look for in a mayor,” Mansoor said. “I think the meetings will be run a lot better.”

Though Genis acknowledged the potential political consequences of her actions, she said she has “tried real hard to live up to my campaign promises,” such as protecting Fairview Park and supporting limits on growth.

But, she added, “I never made a commitment to put anybody in as mayor.”

Foley expressed “sincere apologies to everyone out there who I have disappointed” but also voiced appreciation for her supporters.

“In the words of Gloria Gaynor, I will survive,” she said, referencing the hit disco song.

She’ll also have a chance to reclaim the mayor’s post in the election next year. Foley is among those who have said they are planning to run for the position.

luke.money@latimes.com

Twitter @LukeMMoney

UPDATES:

3:55 p.m.: This article was updated with John Stephens’ comment about a possible challenge to the decision.

9:55 a.m.: This article was updated with the city attorney’s comment.

This article was originally published at 8:35 a.m.