A teammate embraces Italy’s Gianluigi Buffon after he saved the decisive shot during Sunday’s penalty shootout against Uruguay at the Confederations Cup third-place match at the Fonte Nova stadium in Salvador, Brazil.

SALVADOR, Brazil — Gianluigi Buffon saved three penalty kicks in a shootout and undermanned Italy edged Uruguay 3-2 Sunday to secure third place at the Confederations Cup following a 2-2 draw.

It was a measure of redemption for Italy after a loss to Spain, also in a shootout, in the semifinals.

“The main thing tonight was our character. We showed fantastic character. We never gave up,” Italy coach Cesare Prandelli said.

Uruguay, meanwhile, has now lost seven of eight bronze-medal matches at the World Cup, Copa America and Confederations Cup, including a loss to Germany at the 2010 World Cup.

This shootout capped an entertaining match at the Arena Fonte Nova, where Alessandro Diamanti scored one goal and set up another for Italy, and Edinson Cavani equalized twice for Uruguay.

“Today would have been tough if we hadn’t had this character,” Buffon said. “We showed what we’re worth down to the end. It would have been upsetting to not win because playing this match two days after the game vs. Spain was very difficult. But we went out with the right spirit.”

Italy defender Davide Astori opened the scoring in the 24th minute after Diamanti’s free kick rattled the post. Cavani equalized for Uruguay in the 58th with an angled shot.

Diamanti restored Italy’s lead in the 73rd with another free kick that went in directly. Not to be outdone, Cavani drew Uruguay even again five minutes later with an equally splendid free kick.

In the shootout, the 35-year-old Buffon set the tone by stopping the first shot from Diego Forlan, then also saved against Martin Caceres’s weak attempt before smothering Walter Gargano’s effort to end the game.

“I told my players before the match, `It’s Italy, boys, so watch out,” Uruguay coach Oscar Tabarez said. “You can’t just go by what you read in the newspapers. Even if they were tired they played a great match. They controlled the ball possession in first half and they made us suffer.”

Italy was without usual starters Mario Balotelli, Andrea Pirlo and several of others, and ended up with 10 men after Riccardo Montolivo picked up his second yellow card in the 110th minute for a foul on Luis Suarez.

Uruguay was at full strength, featuring virtually the same lineup from its 2-1 semifinal loss to Brazil. With an added day of rest, Uruguay had its usual strike trio of Forlan, Suarez and Cavani in place.

Still, for the first 90 minutes it was a balanced match featuring numerous opportunities for both sides.

With Leonardo Bonucci on the bench after missing the key shot in the shootout loss to Spain, Astori saw his first action in the tournament and he quickly took advantage.

After hitting the post, Diamanti’s free kick deflected off the back of Muslera and Astori was waiting for an easy tap-in.

However, there were doubts over whether the ball had already gone in when Astori touched it. FIFA first awarded the goal to Diamanti, then gave it to Astori at halftime — making it his first goal for Italy, in his fifth appearance.

While Italy appeared content to head into halftime with a one-goal lead, Uruguay came out energized in the second half. Cavani slotted a shot past outstretched Buffon after being set up by Gargano.

Diamanti’s goal, also his first for Italy, came with a curling free kick from 28 yards over Uruguay’s wall and into the right corner beyond the reach of a diving Muslera.

The lead didn’t last long. Cavani produced a shot over Italy’s wall that dipped in under the crossbar with Buffon unable to stop it despite getting his fingertips on it.

In extra time, Uruguay dominated but could not find the target with a series of shots from beyond the area, while Italy appeared exhausted. Fortunately for the Italians, Buffon was still alert and made the decisive saves.

“Buffon is a great champion. He plays with a kid’s enthusiasm,” Prandelli said. “He was upset the other night because he wasn’t able to save a penalty. And he told the squad this morning that if it goes to penalties today, `Don’t worry I’ll take care of it.”’