Luis Suarez and Lionel Messi scored as leaders Barcelona regained their five-point lead at the top of La Liga by beating 10-man Villarreal.
Barca were facing a third successive league game without a win after Suarez and Gerard Pique hit the woodwork.
The game was goalless when Villarreal midfielder Daniel Raba was shown a straight red card for an ugly 60th-minute challenge on Sergio Busquets.
Suarez rounded the keeper to score 12 minutes later before Messi made it 2-0.
Villarreal, who are sixth in the table, made Barca work hard for their 12th league win in 15 matches this season.
It required a fine one-handed save by goalkeeper Marc-Andre ter Stegen to keep out Roberto Soriano when the game was goalless.
However, Barca made their extra man count with two goals in 11 minutes.
Valencia are second in the table, while Atletico Madrid are third, six points behind Barca, after Saul scored their winner in a 1-0 victory at Real Betis earlier on Sunday.
Real Madrid, who hammered Sevilla 5-0 on Saturday, are fourth - eight points behind Barca, who they host on the 23 December.
A Lionel Messi hat-trick ensured Argentina came from behind to win in Ecuador and avoid missing a World Cup finals for the first time since 1970.
The 2014 runners up began the day sixth in the group and needing a top-four place to qualify automatically.
They made a terrible start in Quito, losing a goal inside 38 seconds, but fought back with Messi to the fore.
"Luckily the nationality of the best player in the world is Argentinian," said coach Jorge Sampaoli.
"We must be sure everything does not depend on Leo [Messi] but today he brought his great ability.
"I told the group: Messi did not owe the World Cup to Argentina, but football owed the World Cup to Messi. We should help him be in the World Cup."
The Barcelona forward equalised in the high-altitude Ecuadorian capital after 12 minutes when he linked up with Paris St-Germain midfielder Angel di Maria and stabbed home.
The five-time world player of the year's second goal came eight minutes later with a powerful strike from the edge of the area before a fine solo goal in the second half sealed the victory and Argentina's passage to Russia.
However, Chile - the winners of the last two Copa America titles - are out after losing 3-0 in Brazil.
Brazil had already qualified and Luis Suarez scored twice as Uruguay beat Bolivia 4-2 to qualify, with Colombia also advancing after a 1-1 draw in Peru.
Peru finished fifth in South American qualifying and will now meet New Zealand in a two-legged play-off.
Chile, who have won the last two Copa America tournaments, were aiming to qualify for their third successive World Cup after reaching the last 16 in 2010 and 2014.
However, they will be one of the most notable absentees in Russia next summer.
They began the final round of matches in third place in the table, but fell behind to two Brazil goals in three second-half minutes from Paulinho and Gabriel Jesus.
With Peru scoring a late equaliser against Colombia, Chile needed to score to be in the play-offs and had everyone in the Brazil half - including Manchester City goalkeeper Claudio Bravo - in injury-time.
However, the attack broke down, Brazil launched the ball forward and Jesus walked the ball into the net for his second with his City team-mate Bravo stranded to confirm Chile's elimination.
Football star Lionel Messi could avoid a 21-month prison sentence for tax fraud by paying a fine, Spanish media are reporting.
Spain's state prosecutor would swap jail time for a fine of €255,000 ($285,000; £224,000), which equates to €400 for each day behind bars.
The final decision on the fine rests in the hands of the Spanish courts.
Messi, along with his father Jorge, was found guilty of defrauding Spain of €4.1m between 2007 and 2009.
The court in Barcelona found they used tax havens in Belize and Uruguay.
As well as the jail terms, the Barcelona star and Argentina international was fined about €2m and his father €1.5m. They made a voluntary €5m "corrective payment", equal to the alleged unpaid tax plus interest, in August 2013.
Messi's appeal against the sentence was rejected by the Supreme Court last month, but his father's jail time was reduced because he paid some of the taxes.
However, Messi was never expected to serve time in jail, as under the Spanish system, prison terms of under two years can be served under probation.
Messi is not the only football star to find himself in trouble over his tax affairs.
Cristiano Ronaldo could be charged with tax fraud after Spain's tax office passed a file onto prosecutors.
Reports in Spain last month said the Portuguese Real Madrid striker, 32, is suspected of defrauding €15m (£13m) between 2011 and 2014.
Meanwhile, José Mourinho's advisers have denied allegations that the Manchester United manager defrauded Spain of €3.3m (£2.9m; $3.6m) in taxes while he was Real Madrid coach from 2011 to 2012.
Manchester United manager Jose Mourinho has been accused of tax fraud by Spanish prosecutors investigating his time as Real Madrid's head coach.
Portuguese-born Mourinho is accused of defrauding Spain of €3.3m (£2.9m; $3.6m) in taxes between 2011 and 2012. He has yet to comment on the claim.
A prosecutor said he did not declare income from the use of his image rights in order to get an "illicit benefit".
Other big names in football have been accused of tax fraud in Spain recently.
Those include Real Madrid star Cristiano Ronaldo, who played under Mourinho and shares the same agent as him. The player is accused of defrauding tax authorities of €14.7m, by also hiding his income from image rights.
He denies the accusations and is threatening to leave Spain. The Portuguese-born star is set to give evidence in his case on 31 July.
Mourinho, 54, is accused of two counts of tax fraud - €1.6m in 2011 and €1.7m in 2012. The Madrid prosecutor said the case was presented to a local court.
Other footballers accused of tax fraud in Spain include:
Chelsea boss Jose Mourinho says the Ballon d'Or prize awarded to the world's best footballer has a negative impact on world football.