The first half was a turgid affair, which only came to life during the closing stages. With four minutes to go before the break Diogo's cross was headed straight into the arms of Esteban Alvarado and Souza shot wide, before Costa Rica broke and Marcos Urena fired a low shot which forced Rafael into a low save.
Despite Brazil having 70 per cent of possession in the first half, it was Los Ticos who came closest when David Guzman's free kick from 25 yards was superbly tipped over the bar by Rafael.
The second half started brightly when Paulo Henrique fired a shot from the edge of the box which was straight at Alvarado. Daniel Varela also saw a shot flash just past the post after another Guzman free-kick was only partially cleared.
Brazil immediately went down the other end on the counter attack and Souza should have scored when well placed, but struck his shot straight at the goalkeeper. Wellington Junior showed great skill to turn Diego Madrigal inside out before firing narrowly wide.
When the deadlock was finally broken by Brazil, there was a touch of good fortune about it. Bertucci's ball from the left was attacked by Alex Teixeira, who only managed to get the faintest of touches on it. It acted as a perfect flick-on for Alan Kardec whose volley from an acute angle flew into the back of the net.
Both sides saw free-kicks go close in the final stages, with Souza's strike flying narrowly over the bar and Guzman's drive inch past the post, but it was A Seleção who were celebrating at the final whistle as they set up a final clash with Ghana.