XP Lee hadn't thought much about the census before attending a 2018 meeting on the nationwide population count for his job with the city of Brooklyn Park.

But he sat up when state officials said Minnesota came within 15,000 people of losing one of its eight seats in Congress a decade ago and things were looking even tighter now.

He figured there were thousands of people undercounted in his own Hmong community.

"I realized you only get this one opportunity every 10 years," said Lee, who decided to leave his job with the city to work on statewide census efforts.

In the end, if Minnesota had counted just 26 fewer people in the 2020 Census, the state would have lost one of its seats in the U.S. House, according to population numbers released last week.

Behind that razor-thin margin was the largest mobilization effort in state history to count as many Minnesotans as possible. Alongside the state, a group of more than 300 cities, counties, advocacy groups and private sector entities put $4  million into door knocking, phone banking, advertising and social media campaigns. They held more than 1,500 events and recruited trusted messengers on reservations and in other communities of color to find people historically under counted by census enumerators.

"When you think about 26 people — every day, every ounce of that effort mattered," said State Demographer Susan Brower, who held the first meetings on the 2020 Census effort as far back as 2015. The Legislature allocated money to the census in 2018, earlier than any other state.

The coalition estimates they reached more than 1.3 million people despite challenges to the decennial population count, including a once-a- century pandemic, technical difficulties and deadline delays.

"There was a period once the pandemic started, through the end of the census count period, where it felt like there were multiple crises a week," said Katina Mortensen, policy directory with the Minnesota Council on Foundations, one of the earliest state census partners.

A push from the Trump administration to add a citizenship question to the form made it even harder to count Minnesota's immigrant and refugee communities who already feared that responding to the census could lead to their deportation.

"The work was an affirmation of how deep the distrust of communities of color is in mainstream systems and how important the message and the messenger is," said Mónica Hurtado from Voices for Racial Justice, who was recruited to go into communities of color to talk about the census effort. "Even for people wanting to do the right thing, it was so difficult and challenging to convince them to do it."

Somali phone bankers dialed others in their community to stress the importance of being counted. On the Red Lake Nation reservation, census workers were paired with tribal members as they went door to door to make sure people filled out their form.

In a state that has a nation-leading voter turnout, groups coupled get-out-the-vote messaging with the census push. They played on the state's civic engagement in ad campaigns, exalting "census nerds" as superheroes. Circle Pines City Council Member Dean Goldberg dressed up in a cape and mask to promote the count.

Motivating the group was the goal of holding onto the state's eight U.S. House seats, 10 electoral college votes and its share of federal aid. Data from the Census Bureau help determine the distribution of billions of federal dollars to states each year.

"This affects health care, this affects education, this affects your rental income, our ability to recruit businesses to our community and keep us growing and help with the tax base," said Judy Thompson, the clerk for the city of Willmar.

The city started promoting the 2020 census three years ago, putting up booths at the county fair and at school conferences. They hit churches, day care centers, grocery stores, libraries and college campuses. Willmar stuck fliers in city utility bills and sent them to every landlord in the community.

Brower said she feared that people would have survey fatigue and not fill out the census form online. Despite expectations that the state's self-response rate would be lower than in 2010, the state surpassed it and led the nation at 75%.

All of this could have helped Minnesota steal away the 435th and final seat in the U.S. House from New York by the closest margin of any state since the 1940s.

According to a complex formula used by the Census Bureau, if Minnesota had counted 26 fewer people or if New York had counted 89 more, the result would have been flipped. In 2010, Minnesota also nabbed the 435th seat away from North Carolina.

Minnesota's near miss may have to survive another test. New York Gov. Andrew Cuomo said he's considering a legal challenge to his state's narrow loss.

Many groups that helped make sure everyone was counted are now turning their attention to the redistricting process, which can't begin in earnest until the U.S. Census Bureau delivers more detailed data by the end of September.

But for now, Minnesota's members of Congress and those involved in the state effort are breathing a sigh of relief.

Many had expected for months to lose a seat, after preliminary numbers from the Census Bureau showed the state 25,000 people short.

"I was watching the Census bureau announcement online and I actually howled at the computer when they said we kept our seat," said Marcia Avner, who consulted on the census with the Minnesota Council on Foundations.

She said it wouldn't have happened without everyone coming together early.

"They are already working on 2030," she laughed.

Briana Bierschbach • 651-925-5042

Twitter: @bbierschbach