MADRID — Huesca will play in the Spanish league for the first time next season.
The small club from northeastern Spain secured the historic promotion by beating Lugo 2-0 on Monday.
The victory guaranteed Huesca at least second place with two matches left in the 22-team second division.
Huesca came close to making it to the first division last season but it was eliminated in the promotion playoffs.
It has been in the second division since 2015.
"We fought hard for this, it’s well-deserved," said Alex Gallar, who scored one of Huesca’s goals on Monday. "I can’t believe it. Huesca is a first-division team. It’s historic. It’s time to celebrate."
Malaga, Deportivo La Coruna and Las Palmas were the teams relegated to the second division this season.