David Luiz lashed home a stunning free kick after Thiago Silva's early goal, with James Rodriguez scoring a penalty to make for a nervous ending to the match.
Brazil continued its unconvincing pursuit of home FIFA World Cup glory by edging out Colombia 2-1 in the quarterfinals on Friday.
Tipped by some to exit against a side which has been the talk of the tournament, Luiz Felipe Scolari's men progressed thanks to goals from Thiago Silva and David Luiz in Fortaleza, the latter a superb 25-yard free kick.
Man-of-the-moment James Rodriguez pulled one back from the spot for Colombia in the 80th minute, yet Brazil held on to book a semifinal meeting with Germany.
However, Brazil will head into the last four with a series of worries, most notably the suspension of Silva and an injury to star man Neymar.
Silva picked up a needless yellow card in the second period, while Neymar was carried off on a stretcher late on to put a dark cloud over Brazil's win.
The duo's potential absences, combined with another workmanlike showing, will do little to dispel claims from the likes of Diego Maradona that Brazil is not good enough to win the tournament.PHOTOS: U.S. fan reactions | Beautiful people in Brazil
Much had been made of Brazil's perceived mental frailties ahead of the match, with players coming under fire for crying during renditions of the national anthem and Scolari's decision to call in a sports psychologist grabbing headlines.
Despite such scrutiny, the home team made a flying start to surge ahead after seven minutes.
Silva was the hero, sneaking behind Carlos Sanchez and kneeing home at the back post from close range after Colombia fatally failed to clear Neymar's corner.
Behind for the first time in the competition, Colombia nearly found an immediate response as Juan Cuadrado's effort was deflected just wide.
Colombia then wasted a Rodriguez-led four-on-two counterattack with the game's end-to-end nature making for a thrilling spectacle.
The second period did not assume the same pace, Jose Pekerman's side failing to find the fluency that has been its calling card.
Indeed, the biggest moment of those exchanges came when Silva collided with Ospina, the subsequent yellow card ruling him out of the next phase.
With chances few and far between, it took a moment of brilliance from Luiz to leave Brazil on the brink of the last four after 69 minutes.
Rodriguez, so often Colombia's star, crucially brought down Hulk 25 yards from goal, paving the way for Luiz to send a stunning curler beyond Ospina.
But just when it seemed a nation could calm down Julio Cesar felled Carlos Bacca in the area.
The goalkeeper was fortunate not to be shown a red, although that had little impact on tournament top-scorer Rodriguez - who continued his record of scoring in every game when he coolly sent Cesar the wrong way.
As if the tension was not palpable enough, many in attendance were left with heads in hands late on as Neymar was taken from the field.
The departure of their talisman did not stop his teammates from defending outstandingly, although Brazil's win came at a cost.