Norway began a heavy favourite as the defending Olympic, world and European champion, and ended the London Games among the Scandinavian country's biggest sports success stories. Crown Prince Hakkon and Princess Mette-Marit were courtside at the Basketball Arena in Olympic Park to watch the victory.
"In team sports, it's the biggest team in Norway," said Norway coach Thorir Hergeirsson. "It's been a tough trip, we had a lot of ups and downs. Today we get paid."
At its second Summer Games competing as an independent nation, Montenegro got its first Olympic medal from a rare resource in a nation of barely 600,000 people.
"I am proud for my girls and especially, for a small country like Montenegro, it is a huge success," coach Dragan Adzic said.
Montenegro unsettled the champion early on but never led after Norway took its first lead midway through the first half.
Still, the champion was defied at times by inspired goalkeeping from Sonja Barjaktarovic, and Montenegro hung in even when it got into second-half foul trouble.
As Norway leaped and hugged at the final whistle, right-winger Linn-Kristin Koren hoisted a large national flag attached to a pole and led the team in a skipping run around the court.
"It's been amazing," said top scorer Linn Jorum Sulland, whose 10 goals Saturday were key. "In the beginning of the Olympics we had some bad matches. I think we've done a really good job."
Montenegro's players celebrated their impressive effort by lining up in their goal area for a team photo, then linked arms around each other's shoulders in a circle and jumped around in unison. The Balkan republic failed to win a medal at the 2008 Beijing Games, or the 2010 Vancouver Winter Olympics.
Norway appeared weighed down by expectation early on, and Barjaktarovic excelled between the posts to help hold the champion to 2-for-13 shooting.
Montenegro was also making its shots and tournament top scorer Katarina Bulatovic was perfect on 7-meter penalty shots. Bulatovic ended with 10 goals, and 53 overall at the London Games.
Norway went ahead in the 15th minute, when Sulland's jump shot made it 5-4. Sulland's seventh first-half goal came right on the buzzer for a 13-10 advantage at the break.
Montenegro got into repeated 2-minute suspension trouble early in the second half, and twice was reduced to playing with two women benched.
Playing with spirited energy to limit likely damage, Montenegro even outscored Norway during one 4-against-6 passage.
The score was levelled at 19-19, but Norway held off its underdog opponent which continued to draw penalties right to the end.
Athletes from Montenegro formerly competed for Yugoslavia and, at the 2004 Athens Olympics, as Serbia and Montenegro.
In the earlier bronze-medal match, Spain beat South Korea 31-29 in double extra time.