AL RAYYAN, Qatar (AP) - Neymar is again going home without a World Cup title. Luka Modric's quest continues unabated.

Modric converted one of the penalties as Croatia knocked Brazil out of the World Cup on Friday, beating the five-time champions 4-2 in a shootout to reach the semifinals for the second straight time.

Neymar tied Pele's record for most goals for the national team, giving Brazil the lead in extra time. But he wasn't among the four Brazilian players to take a penalty in the shootout, instead reduced to tears on the field at Education City Stadium while the red-and-white clad Croatians celebrated.

“It feels like a nightmare. It's hard to believe this is happening,” said Neymar, who kept his future with the national team open after the defeat.

Brazil coach Tite said he had saved his best player to take the fifth penalty.

“That's the one with the most pressure, and he would be the player with the most quality and mental preparedness to take the shot,” Tite said.

Croatia goalkeeper Dominik Livakovic saved the first penalty attempt by Rodrygo and Marquinhos later hit the post. Livakovic had already produced some key stops as the teams drew 0-0 in regulation and 1-1 in extra time.

“We are raised as fighters, giving our best,” Livakovic said. ”And that's the recipe for success.“

Five of Croatia's last six matches at World Cups have gone to extra time, including its penalty shootout win over Japan in the round of 16 in Qatar. The team has been successful in eight of its last 10 knockout matches at the tournament.

Croatia came from behind in every game of the knockout stage in 2018, and again in the two elimination matches it has played in Qatar.

“We have a strong character and we do not give up,” Croatia coach Zlatko Dalic said. “We were prepared for everything today. We knew that as the game unfolded, our chances improved.”

Nikola Vlasic, Lovro Majer and Mislav Orsic also converted their penalties for Croatia, while Casemiro and Pedro scored for Brazil.

Both goals came in the additional 30 minutes, first with Neymar scoring late in the first half of extra time to give Brazil the lead, and then with Bruno Petkovic equalizing in the 117th.

Neymar's goal moved him into a tie with Pele as Brazil's all-time leading scorer with 77 goals, but the forward again fell short of winning a major title with Brazil and had to be consoled by veteran defender Dani Alves as he cried after the match.

Croatia will next face Argentina on Tuesday to try to return to the World Cup final four years after losing the title to France. The Argentines beat the Netherlands in a shootout.

Brazil was looking to reach the semifinals for the first time since 2014. The team hadn't made it that far since hosting the tournament eight years ago, when the Selecao was embarrassed by Germany 7-1.

Brazil was trying to defeat a European opponent in the knockout stage of the World Cup for the first time since the 2002 final against Germany, when the team won for the last time.

Neither Neymar nor Modric could do much to give their teams significant chances early on, as both teams played cautiously in attack and defense. Brazil was better after halftime and came closer to scoring.

Neymar, starting for the second game in a row after recovering from an ankle injury sustained in Brazil's opening match, had some of his team's best opportunities, including a couple close-range attempts saved by Livakovic.

“He was the difference on very crucial moments,” Dalic said of his goalkeeper. “He was there to save us.”

Neymar scored his milestone goal after dribbling past Livakovic inside the area and sending a shot into the top of the net. Brazil was a few minutes from victory when Petkovic scored with a left-footed shot that deflected off Marquinhos before getting past Brazil goalkeeper Alisson Becker. It was Croatia's only attempt on target, against 11 by Brazil.

“It's hard to find the words. We are upset,” Casemiro said. “Especially because of how it happened, we had it in our hands. It's tough. We have to lift our heads and try to move on.”

TITE'S DEPARTURE

It was Brazil's last match under Tite, who had said before the World Cup began that he was not going to stay with the national team.

“It's the end of a cycle,” Tite said. “The loss hurts, but I'm at peace with myself right now.”