BOSTON — A gay veterans group said Wednesday it has been denied permission to march in this year’s Boston St. Patrick’s Day parade just two years after organizers made the groundbreaking decision to allow gay groups to participate for the first time.

The veterans group, OutVets, said on its Facebook page that the reason for the denial is unclear, but “one can only assume it’s because we are LGBTQ.”

The South Boston Allied War Veterans Council, the parade’s organizer, drew immediate condemnation from Boston Mayor Marty Walsh, who said he would not participate in the March 19 parade unless the council reversed course.

“I will not tolerate discrimination in our city of any form,” he said in a statement.

Republican Gov. Charlie Baker said he would not participate either, while Democratic U.S. Rep. Seth Moulton called for a boycott of the parade. Moulton, who served four tours of duty in Iraq, has marched with OutVets previously.

Restricting a veterans group from marching in a parade that honors veterans “doesn’t make any sense to me,” Baker said.

This year’s chief marshal, Dan Magoon, the executive director of Mass Fallen Heroes, resigned over the vote.

“The freedom that we possess to hold such an event as the St. Patrick’s parade is due to the men and women who have spilled their blood in defense to this great nation, regardless of their race, religion, gender or sexual orientation,” he said in a letter to the council.

Democratic state Sen. Linda Dorcena Forry, whose district includes South Boston, asked the council to reconsider.

The vote left OutVets leadership stunned.

The council gave no reason for its 9-4 vote, Bishop said.