The best and worst of Zlatan Ibrahimović was on show Tuesday as he scored and later was sent off in AC Milan's 2-1 loss at city rival Inter Milan in the quarterfinals of the Italian Cup.

Ibrahimović clashed with former teammate Romelu Lukaku at the end of the first half, and he was ejected for a second booking in the 58th minute.

More Images
AC Milan's Zlatan Ibrahimovic walks off the pitch after getting a red card during the Italian Cup, quarterfinal soccer match between Inter Milan and AC Milan, at the San Siro Stadium in Milan Italy, Tuesday,  Jan. 26, 2021. (SpadaLaPresse via AP)

The best and worst of Zlatan Ibrahimović was on show Tuesday as he scored and later was sent off in AC Milan's 2-1 loss at city rival Inter Milan in the quarterfinals of the Italian Cup.

AC Milan's Zlatan Ibrahimovic, left, receives a red card during an Italian Cup round of 8 soccer match between Inter Milan and AC Milan at the San Siro stadium, in Milan, Italy, Tuesday, Jan. 26, 2021. (AP PhotoAntonio Calanni)

Inter will play Juventus or Spal in the semifinals. They meet on Wednesday.

AC Milan's Zlatan Ibrahimovic, center, celebrates after scoring his side's opening goal during the Italian Cup, quarterfinal soccer match between Inter Milan and AC Milan, at the San Siro Stadium in Milan Italy, Tuesday,  Jan. 26, 2021. (SpadaLaPresse via AP)

It did take the lead in the 31st minute when Ibrahimović controlled the ball on the edge of the area before placing an angled drive between the legs of Inter defender Aleksandar Kolarov. It went in off the base of the far post.

Inter Milan goalkeeper Samir Handanovic reacts after AC Milan's Zlatan Ibrahimovic scored during the Italian Cup, quarterfinal soccer match between Inter Milan and AC Milan, at the San Siro Stadium in Milan Italy, Tuesday,  Jan. 26, 2021. (SpadaLaPresse via AP)

And Inter was level 13 minutes later. Leão brought down Nicolò Barella and, after viewing the incident again on the pitchside monitor, the referee pointed to the spot. Lukaku slammed the penalty into the top left corner.

Inter Milan's Romelu Lukaku, center, celebrates after scoring a penalty shoot during an Italian Cup round of 8 soccer match between Inter Milan and AC Milan at the San Siro stadium, in Milan, Italy, Tuesday, Jan. 26, 2021. (AP PhotoAntonio Calanni)

More AP soccer: https://apnews.com/Soccer and https://twitter.com/AP_Sports

Inter Milan's Romelu Lukaku scores on a penalty shoot during an Italian Cup round of 8 soccer match between Inter Milan and AC Milan at the San Siro stadium, in Milan, Italy, Tuesday, Jan. 26, 2021. (AP PhotoAntonio Calanni)

Inter Milan's Romelu Lukaku scores on a penalty shoot during an Italian Cup round of 8 soccer match between Inter Milan and AC Milan at the San Siro stadium, in Milan, Italy, Tuesday, Jan. 26, 2021. (AP PhotoAntonio Calanni)

Inter Milan's Christian Eriksen scores his team second goal during an Italian Cup round of 8 soccer match between Inter Milan and AC Milan at the San Siro stadium, in Milan, Italy, Tuesday, Jan. 26, 2021. (AP PhotoAntonio Calanni)

Inter Milan's Christian Eriksen scores his team second goal during an Italian Cup round of 8 soccer match between Inter Milan and AC Milan at the San Siro stadium, in Milan, Italy, Tuesday, Jan. 26, 2021. (AP PhotoAntonio Calanni)

Lukaku converted a penalty for the equalizer and Christian Eriksen scored the winner deep in stoppage time.

AC Milan's Zlatan Ibrahimovic walks off the pitch after getting a red card during the Italian Cup, quarterfinal soccer match between Inter Milan and AC Milan, at the San Siro Stadium in Milan Italy, Tuesday,  Jan. 26, 2021. (SpadaLaPresse via AP)

AC Milan's Zlatan Ibrahimovic walks off the pitch after getting a red card during the Italian Cup, quarterfinal soccer match between Inter Milan and AC Milan, at the San Siro Stadium in Milan Italy, Tuesday, Jan. 26, 2021. (SpadaLaPresse via AP)

Inter will play Juventus or Spal in the semifinals. They meet on Wednesday.

The two Milan clubs are also fighting it out in the league, with the Rossoneri leading second-place Inter by two points.

Milan started the brighter and almost immediately went in front when Rafael Leão fired just past the left post.

AC Milan's Zlatan Ibrahimovic, left, receives a red card during an Italian Cup round of 8 soccer match between Inter Milan and AC Milan at the San Siro stadium, in Milan, Italy, Tuesday, Jan. 26, 2021. (AP PhotoAntonio Calanni)

AC Milan's Zlatan Ibrahimovic, left, receives a red card during an Italian Cup round of 8 soccer match between Inter Milan and AC Milan at the San Siro stadium, in Milan, Italy, Tuesday, Jan. 26, 2021. (AP PhotoAntonio Calanni)

It did take the lead in the 31st minute when Ibrahimović controlled the ball on the edge of the area before placing an angled drive between the legs of Inter defender Aleksandar Kolarov. It went in off the base of the far post.

There was a huge argument between Ibrahimović and Lukaku on the stroke of halftime and both were booked. The spat between the former Manchester United teammates continued after the halftime whistle and a visibly furious Lukaku had to be pulled back.

That was to prove costly for Ibrahimović as he was shown a second yellow card after the break for a tackle on Kolarov and sent off, leaving his side down to 10 men.

AC Milan's Zlatan Ibrahimovic, center, celebrates after scoring his side's opening goal during the Italian Cup, quarterfinal soccer match between Inter Milan and AC Milan, at the San Siro Stadium in Milan Italy, Tuesday,  Jan. 26, 2021. (SpadaLaPresse via AP)

AC Milan's Zlatan Ibrahimovic, center, celebrates after scoring his side's opening goal during the Italian Cup, quarterfinal soccer match between Inter Milan and AC Milan, at the San Siro Stadium in Milan Italy, Tuesday, Jan. 26, 2021. (SpadaLaPresse via AP)

And Inter was level 13 minutes later. Leão brought down Nicolò Barella and, after viewing the incident again on the pitchside monitor, the referee pointed to the spot. Lukaku slammed the penalty into the top left corner.

The match had a lengthy delay as referee Paolo Valeri received treatment for a thigh injury and was eventually replaced by the fourth official.

Milan goalkeeper Ciprian Tătăruşanu pulled off a number of saves but it wasn't enough. Just as the match appeared to be heading into extra time, Eriksen curled a free kick into the top left corner in the seventh minute of stoppage time.

Inter Milan goalkeeper Samir Handanovic reacts after AC Milan's Zlatan Ibrahimovic scored during the Italian Cup, quarterfinal soccer match between Inter Milan and AC Milan, at the San Siro Stadium in Milan Italy, Tuesday,  Jan. 26, 2021. (SpadaLaPresse via AP)

Inter Milan goalkeeper Samir Handanovic reacts after AC Milan's Zlatan Ibrahimovic scored during the Italian Cup, quarterfinal soccer match between Inter Milan and AC Milan, at the San Siro Stadium in Milan Italy, Tuesday, Jan. 26, 2021. (SpadaLaPresse via AP)

More AP soccer: https://apnews.com/Soccer and https://twitter.com/AP_Sports

Inter Milan's Romelu Lukaku, center, celebrates after scoring a penalty shoot during an Italian Cup round of 8 soccer match between Inter Milan and AC Milan at the San Siro stadium, in Milan, Italy, Tuesday, Jan. 26, 2021. (AP PhotoAntonio Calanni)

Inter Milan's Romelu Lukaku, center, celebrates after scoring a penalty shoot during an Italian Cup round of 8 soccer match between Inter Milan and AC Milan at the San Siro stadium, in Milan, Italy, Tuesday, Jan. 26, 2021. (AP PhotoAntonio Calanni)

Inter Milan's Romelu Lukaku scores on a penalty shoot during an Italian Cup round of 8 soccer match between Inter Milan and AC Milan at the San Siro stadium, in Milan, Italy, Tuesday, Jan. 26, 2021. (AP PhotoAntonio Calanni)

Inter Milan's Romelu Lukaku scores on a penalty shoot during an Italian Cup round of 8 soccer match between Inter Milan and AC Milan at the San Siro stadium, in Milan, Italy, Tuesday, Jan. 26, 2021. (AP PhotoAntonio Calanni)

Inter Milan's Christian Eriksen scores his team second goal during an Italian Cup round of 8 soccer match between Inter Milan and AC Milan at the San Siro stadium, in Milan, Italy, Tuesday, Jan. 26, 2021. (AP PhotoAntonio Calanni)

Inter Milan's Christian Eriksen scores his team second goal during an Italian Cup round of 8 soccer match between Inter Milan and AC Milan at the San Siro stadium, in Milan, Italy, Tuesday, Jan. 26, 2021. (AP PhotoAntonio Calanni)