Inter and Manchester United on Monday became the first semifinalists of the Europa League.
A Romelu Lukaku-powered Inter beat Bundesliga side Bayer Leverkusen 2-1.
Inter started strongly on a baking Dusseldorf night and took the lead through Barella in the 15th minute. Lukaku caused chaos in the area and had a shot which was blocked, but his teammate finished neatly to put the Italians ahead.
Lukaku was on the scoresheet himself six minutes later with a cunning strike as he fell after showing grit to beat Edmond Tapsoba.
Havertz scored for Leverkusen by drilling home after receiving a pass from Kevin Volland to keep his team in with a chance.
Inter were awarded a penalty for handball but revision by video assistant referee (VAR) showed no offense had been committed by Daley Sinkgraven, who blocked a cross with his shoulder.
Leverkusen battled hard in the second half but their hopes appeared to be dashed in the 90th minute when Christian Eriksen was felled by Karim Bellarabi in the box. However, Inter were once more denied the penalty by VAR, as the ball had hit Barella's hand while he lay on the ground just before the foul.
Lukaku, who had been due to take both cancelled spot kicks, was then denied a goal as he powered past the hapless Tapsoba and was adjudged to have fouled the defender.
Meanwhile, Manchester United needed an extra-time penalty from Bruno Fernandes to scrape into the semifinals after beating Copenhagen 1-0.
In sweltering heat, United's young team controlled the lion's share of possession but had a hard time creating clear chances until Andreas Bjelland brought down Anthony Martial in the penalty area. Fernandes blasted the ball past the otherwise excellent goalkeeper Karl-Johan Johnsson to give United the 95th-minute lead.
Mason Greenwood and Fernandes hit the woodwork with shots during normal time and earlier video reviews cost United two of its best opportunities to score.
First, VAR scratched off a United penalty for offside in the buildup. Just before the break Greenwood put the ball in the net after a lightning break down the right flank but the replay showed he'd been just offside when Marcus Rashford's pass was played.
That decision was a particular blow for United after the apparent breakthrough goal came just as the English team had seemed to be getting frustrated and taking increasingly speculative shots against a Danish team playing its first ever European quarterfinal.
Copenhagen striker Mohamed Daramy muscled his way past the United defense to shoot in the 17th but had his shot blocked by Harry Maguire, and Jens Stage's follow-up was blocked, too.
Inter faces either Basel or Shakhtar Donetsk, while United plays five-time Europa League winner Sevilla or English club Wolverhampton in the semifinals. The remaining quarterfinals will be played Tuesday.