The dank South Boston warehouse held a chill last weekend when the flatbed arrived, a 20-foot-long landscaping trailer with a wood plank floor stained by dirt. Around the flatbed gathered almost a dozen people — predominantly men from the surrounding blocks — wearing winter coats and work gloves.

The job ahead was daunting: transforming the flatbed into a parade float with seven faux cannons. From each cannon would flow a different color of the rainbow — fabric draped over plastic piping — landing in a pot of gold.

Randy Foster and Steve Martin had done this before. They built a 12-foot-long wedding cake float for Provincetown’s Carnival on Aug. 20, 2009, the day they married. This was different. This float was for the South Boston St. Patrick’s Day Parade, which had banned gay organizations for two decades, a precedent enshrined by the US Supreme Court.

As a political standoff raged in recent weeks between parade organizers and the statewide gay advocacy group MassEquality, planning for this float continued with little notice. Momentum had been building for a year. There is a lot about this controversy people don’t know.

* * *

Get Fast Forward in your inbox:

Forget yesterday's news. Get what you need today in this early-morning email.

Last weekend as work had just begun on the flatbed, Brian R. Mahoney, the parade’s chief marshal, bounded into the chilly warehouse. Mahoney wore a shamrock tie and flipped aviator-style sunglasses up on his forehead. He greeted Foster with a hug.

“On behalf of the Allied War Veterans, I’d like to present you with your acceptance,” Mahoney said, handing Foster a thick, white envelope. “It’s going to be a great day. It’s a great thing you’re doing.”

Foster and his friends and neighbors are not marching Sunday as part of a gay organization. They are marching as South Boston residents who have coalesced around building a park in a corner of the neighborhood known as the Lower End. Many of the people working on the float just happen to be gay. And they have been embraced by the Allied War Veterans Council, the parade’s longtime sponsor.

“They know us as their neighbors first and as gay second,” said Foster, an Air Force veteran who served in Desert Storm and who has lived with his husband in South Boston for seven years. Of outside gay groups coming in and hoping to march, he said: “How in the world do you ever get compromise if the first statement out of your mouth is, ‘I'm different than you?’ ”

Fact: South Boston has a substantial and growing gay population. Fact: A second neighborhood contingent with gay marchers will also be in the parade. Fact: Bill Linehan, City Council president, attacked as unfriendly to gay causes recently by some liberal activists, has been a catalyst behind the scenes to get the neighborhood groups accepted in the parade.

JOHN TLUMACKI/GLOBE STAFF

Randy Foster (left), with his husband, Steve Martin, in South Boston. Foster has lived in South Boston for seven years.

“It just seemed the timing was right this year for a new change,” Linehan said, noting that Boston had a new mayor, Mahoney is chief marshal, and there was interest in marching from two local groups with gay members. “There are other ways to do things, even if they are not as public, not as volatile, and not as contentious.”

In its parade application, the Lower End contingent described its entry as a “diversity float” that would welcome people of all races, ethnicities, and sexual orientations. Marchers are expected to wear suits and ties or other business attire accented with a scarf to celebrate the diversity of South Boston.

Acceptable scarves — which were agreed to by marchers and parade organizers — include colors of any national flag, a peace sign, a rainbow for diversity, or an equal sign for gay rights. The application noted that “this small token of wearing a unique scarf would allow us to move toward inclusion.”

“The only way for this to work was to keep quiet. We had to wait it out and prove what we said when we first started, that we’re not here to make a big statement,” Foster said last Saturday, taking a break from float construction. “We all thought, if we just show up on parade day and we march and have a cool float, people will understand.”

A week remained until the parade. The flatbed still looked more like a landscaping trailer than a cool float. They had work to do.

* * *

‘They know us as their neighbors first and as gay second.’ - Randy Foster, who has lived with his husband, Steve Martin (left), in South Boston for seven years.

On the sidewalk outside their home, Foster and Martin set up two sawhorses and began tracing 2-foot-wide circles on a sheet of plywood — faux wheels for the canons. A Lincoln Town Car slowed to a stop. The driver wore a blue baseball cap marking him as a World War II veteran. “You got a carpentry permit for that?” the elderly man yelled out the window.

Martin looked up and walked to the curb with a broad smile. “We got in,” Martin said. “We’re building a float.”

Foster walked up behind Martin. “We’ll be up at the Cornerstone for beers later,” Foster said, referring to the West Broadway tavern. “We’ll see you there.”

* * *

South Boston has always had gay residents. In 1992, the neighborhood became a battle ground for the gay rights movement when parade organizers rejected an application to march from the Irish-American Gay, Lesbian, and Bisexual Group of Boston. The fight landed in the US Supreme Court, which handed down a unanimous ruling.

While the parade might march on public streets, it was a privately organized event protected by the First Amendment right to freedom of speech, the court decreed. Organizers had the right to include — or reject — any group they wanted.

The precedent has been used far beyond Boston, cited by the Boy Scouts to exclude gay scoutmasters and employed by organizers of gay pride marches to keep out hate groups.

In South Boston, parade organizers have said no to hate groups such as the Ku Klux Klan and the Westboro Baptist Church. They have barred an organization that said it represented Irish heterosexual pride, an antiabortion organization, and a contingent that wanted to demonstrate against court-mandated school busing, according to Mahoney, the chief marshal.

Lead parade organizer Philip J. Wuschke Jr. acknowledged that the inclusion this year of two groups with gay marchers represented “a little bit of a step,” but he pushed back against the assertion that the parade is intolerant.

“Gay people march in this all the time. Every year. This isn’t the first time,” Wuschke said. “We don’t ban gay people. We ban groups that are trying to make a statement.”

* * *

In the two decades since the court ruling, South Boston has undergone tremendous change while clinging fiercely to its identity. Some gay residents endured hostility in the aftermath of the ruling, but remained in the neighborhood and have long been eager for healing. But an influx of young professionals also brought waves of new gay residents.

That included Sameer Bhoite and David Warner, a couple for 17 years who bought a home on K Street in 2002. Like many others, they were drawn by the relative affordability of housing and the neighborhood’s unique identity.

“We really loved South Boston because it had a tight-knit, family feel. Everybody knew each other,” said Warner, who hosts a St. Patrick’s Day party steps from the parade route. “For us, it was live and let live. We didn’t come in and fly a big gay flag outside our house. We just came in and fit in.”

The Lower End is the side of South Boston closest to the rest of the city, where the neighborhood bumps against a rail yard and the Southeast Expressway. The grid of rectangular blocks had traditionally been home to factories, warehouses, and a tightly knit enclave of working-class families.

“There are more people moving in from the South End. Many of them happen to be gay,” said Linehan, the city councilor. “We’re all living together. That’s a good thing.”

The migration came in part as real estate prices climbed in the nearby South End, once the epicenter of Boston’s gay community.

“They used to say that the South End is 3 miles and 30 years from Southie,” said Paul Smith, a 42-year-old Irish Catholic who wears a scally cap, has lived in both neighborhoods, and is gay. “That hasn’t been true in a long time.”

A building boom in the Lower End has forged strong bonds between newcomers and longtime residents. In their seven years in the neighborhood, Foster and Martin, the two men spearheading the neighborhood float, became active in the St. Vincent’s Lower End Neighborhood Association. They worked together with longtime South Boston residents to restrain building heights, push for more parking, and fight to retain the character of the place they call home.

“All these residents of St. Vinny’s are my friends and neighbors first. If they are gay or straight, it really doesn’t come in to it,” said Mahoney, who is also a member of the community group. “We found through our conversations that we have much more in common than opposition. These are good people. These are Southie people.”

Embracing local history, Foster and others have persuaded the city to build a park to commemorate the neighborhood’s role in the Revolutionary War battle that forced the British out of Boston. Seven cannons were placed in the Lower End as strategic support to the rebels’ main encampment atop Dorchester Heights. The British left Boston on March 17, 1776, a milestone dubbed Evacuation Day. The parade celebrates both the British defeat and St. Patrick.

“We had all been having St. Patrick’s Day parties for a while,” Foster said. “It kind of bugged me that there was this feeling we weren’t accepted.”

* * *

In October, Foster approached Linehan, the local city councilor, at a meeting in a neighbors's house. He asked Linehan, “When are we going to get over this gay St. Patrick’s Day thing?”

It turns out, talks had been underway. The day after the 2013 parade, Mahoney met with Michael Dowling and Bob Monahan from the South Boston Association of Non-Profits. They wanted to march, but some of their members are gay.

Mahoney encouraged them to apply, insisting the parade banned groups making political statements, not gays. It took time, and there were sticking points about signs and other issues.

“I would go back and report to [the Allied War Veterans] and they would say, ‘Bri, do this and do this, don’t stop talking,’ ” Mahoney said. “Sometimes, conversation can lead to resolution.”

The Association of Non-Profits — which included on its application that it had members who were lesbian, gay, bisexual, and transgender — was ultimately accepted. The group declined to comment because of the volatility of the issue in recent weeks.

* * *

Back in December, when Foster was preparing his application for a float, he knew it was about more than a parade.

“Many of the residents and supporters of preserving the heritage of the Lower End of Southie are not of Irish descent, and many are gay,” Foster wrote in an e-mail sent with his application. “They feel excluded from the Evacuation Day parade, while at the same time, they are very proud of the Southie heritage stemming from The Siege of Boston that underscores we do NOT like others, especially outsiders, telling us how to shape South Boston.”

Foster suggested that this could be a way to “quietly begin including those who have felt excluded from the parade in the past (including myself).”

“If we do this right,” Foster wrote, “everyone, from the governor to the new mayor, to our new neighbors, can all be a part of your wonderful parade.”

The final push came Saturday, with Foster at a sewing machine stitching swaths of red, orange, and yellow fabric for the rainbow. Mahoney stopped by to help, grabbing a paint brush to touch up a swatch of the float meant to invoke the blue water of Boston Harbor.

The Keenan family came from B Street, with 12-year-old Cole and 9-year-old Molly. The kids stuffed balloons under gold fabric on a black cauldron that will serve as the pot of gold. They were soon covered in gold paint. Their mother, Leanne Keenan, didn’t mind.

“Randy and Steve spearheaded this project. They are so involved in the neighborhood. Just knowing them makes you want to help,” Keenan said. “It’s a community effort. So why wouldn’t I be here?”

BostonGlobe.com complimentary digital access has been provided to you, without a subscription, for free starting today and ending in 14 days. After the free trial period, your free BostonGlobe.com digital access will stop immediately unless you sign up for BostonGlobe.com digital subscription. Current print and digital subscribers are not eligible for the free trial.

Thanks & Welcome to Globe.com

You now have unlimited access for the next two weeks.

BostonGlobe.com complimentary digital access has been provided to you, without a subscription, for free starting today and ending in 14 days. After the free trial period, your free BostonGlobe.com digital access will stop immediately unless you sign up for BostonGlobe.com digital subscription. Current print and digital subscribers are not eligible for the free trial.