Manu Garcia and Raul Garcia scored the goals as Alaves beat Numancia 2-0 to secure promotion from Spain's Segunda Division.
The Basque club will play La Liga football for the first time in 10 years next season.
Alaves were two goals to the good at half-time to put the Estadio de Mendizorroza in party mood.
Leganes are well placed to join Alaves in the top flight next season, in second place with one match to play, but Gimnastic Tarragona are lurking just a point behind.
Alaves could have a say in who joins them in promotion, as they travel to Gimnastic on the final day, while Leganes head to Mirandes.
Get the best features, fun and footballing frolics straight to your inbox every week.
Thank you for signing up to Four Four Two. You will receive a verification email shortly.
There was a problem. Please refresh the page and try again.