MADRID (AP) — Qualifying for the World Cup wasn't as easy as usual for Spain this time.

“La Roja” will be playing at the tournament for the 12th straight time, but the team needed to overcome some bumps in the road to get to Qatar.

After cruising in recent campaigns, Spain's qualification for the 2022 tournament was in doubt until the final minutes of the final group game. It wasn’t until Álvaro Morata’s 86th-minute goal in a 1-0 win over Sweden that Spain could finally feel some relief.

“We suffered a lot, but the players always had faith and they deserved this reward,” Spain coach Luis Enrique said. “We are in the World Cup. To be honest, this takes a huge weight off my shoulders.”

Luis Enrique and his players celebrated profusely after the final whistle at the La Cartuja Stadium in Seville.

A loss against Sweden would have relegated Spain to a difficult playoff with 11 other nations next year, leaving the team in danger of missing out on the World Cup for the first time since 1974.

Spain had cruised in its World Cup qualifying campaigns since having to go through the playoffs ahead of the 2006 tournament in Germany, when it got past Slovakia to secure its berth after finishing second to Serbia and Montenegro in its qualifying group.

There was no drama in 2010, with Spain winning all of its 10 matches to easily qualify for the tournament that it eventually won in South Africa.

The World Cup title secured Spain an automatic spot for the 2014 tournament in Brazil, and four years later the team comfortably qualified in advance despite playing in a group that included Italy.

Luis Enrique’s team struggled from the start this time, opening with a 1-1 home draw against Greece and losing 2-1 at Sweden after a couple of hard-fought victories against Georgia and Kosovo.

Spain was behind Sweden in the group standings until the final round, when it arrived in first place after it won at Greece and Sweden stumbled at already eliminated Georgia. That meant the draw would have been enough against Sweden.

“I felt a lot more pressure in these last games than in the European Championship or in the Nations League,” said Luis Enrique, who will be coaching in his first World Cup if he remains in charge until then. “When you have to achieve something that is supposedly easy or expected, you come under a lot of pressure.”

He said the players felt they were in the spotlight as well because they faced the danger of being tagged as the ones who failed to qualify Spain for a World Cup after so long.

“We worked the psychological aspect to give the players the needed confidence,” Luis Enrique said. “We had enough to win the match.”

Sweden, which threatened until Morata’s goal, goes into the playoffs with the other nine group runners-up and two group winners from the UEFA Nations League. The 12 countries will play next March in three four-team brackets, with the seeded teams getting a home game in the bracket semifinals.

Spain will be only watching, and preparing for yet another World Cup appearance.

__