San Francisco Police Chief Bill Scott displays a 49ers jersey while accepting a challenge from his counterpart in Green Bay, Wisconsin. The two chiefs agreed to wear the jersey of the winning team in Sunday's NFC Championship matchup between the 49ers and Packers. (Photo courtesy of San Francisco Police Department)

As the San Francisco 49ers celebrate their NFC Championship and prepare for the team’s seventh trip to the Super Bowl, a few officials in Green Bay, Wisconsin, this week were swallowing their Packer pride and sporting red-and-gold attire in the name of charity.

San Francisco Mayor London Breed and Green Bay Mayor Eric Genrich, along with their police and fire chiefs, agreed to friendly wagers on Sunday’s title game between the Packers and Niners — a game won in dominant fashion by the Bay Area hosts, 37-20.

The mayors’ bet was more of a challenge. Both planned to volunteer in their communities regardless of the game’s outcome, but the mayor of the losing team would have to do so while wearing the colors of the winning team.

Green Bay Police Chief Andrew Smith sports his 49ers jersey on Monday. (Photo courtesy of Green Bay Police Department)

After Sunday’s NFC Championship game, the mayors and contingents of their staff agreed to volunteer at Boys & Girls Clubs in their respective cities.

“I hope Mayor Genrich is ready to wear Niners red and gold during our day of service!” Breed said last Friday when she accepted the “win-win playoff challenge” from  of Green Bay.

The police chiefs of the two cities also agreed to a friendly wager.

San Francisco Chief Bill Scott and Green Bay Chief Andrew Smith, who once worked together at the Los Angeles Police Department, agreed they would wear the winning team’s jersey if their team lost. To fulfill his part of the bet, Smith had to post a photo of himself on social media wearing the 49ers’ team colors. In addition, he also will donate $50 to the San Francisco Police Foundation.

Prior to the game, Chief Scott posted a video on Facebook, saying that he would reluctantly don the green and gold jersey if the Packers won.

The Green Bay Police Department responded on its own Facebook page: “It would be a little difficult to find a 49er jersey in Wisconsin, but we are confident it won’t be needed (Need we remind them of 1997?)”

The San Francisco and Green Bay fire departments also agreed to a friendly challenge, with an emphasis on fire safety.

On the Tuesday following the game, Green Bay Fire Chief David Litton was expected to wear a 49ers jersey for the day and install a smoke alarm with the team’s emblem on it. The 49ers will receive a donation of 50 smoke alarms from Kidde.

Both departments released a fire safety announcement on social media at halftime during the NFC Championship game.

As the loser in the wager, Litton has also agreed to personally donate $100 to a Burn Camp/Prevention charity of the San Francisco Fire Chief Jeanine Nicholson’s choice.

The 49ers are making their first trip back to the Super Bowl since losing to the Baltimore Ravens in 2013. They will seek their sixth league championship when they face the Kansas City Chiefs, who are making their first appearance in the title game since their lone championship in 1970.

Super Bowl LIV takes place Sunday, Feb. 2, at Hard Rock Stadium in Miami Gardens, Florida, with kickoff scheduled for 3:30 p.m.