Osasuna came from behind to beat Racing Santander 4-2 on Sunday.
It was the home side who started the better and they took the lead after just two minutes when Christian Stuani headed on from Jairo Samperio into the net.
Osasuna were next to come close after five minutes with an effort from Ruben, but he missed from close range.
The away side continued to carve out openings as the half advanced and Ruben might have drew Osasuna level after 20 minutes, but he headed wide.
Chances continued to fall for the away side with Raul Garcia and Marc Bertran coming close in the latter stages of the half, but it remained 1-0 at the break.
Osasuna continued to dominate early in the second period, and Garcia's strike after 52 minutes was beaten away by Fernandez Mario.
The away side equalised seconds later, however, when Ibrahima Balde headed a David Timor cross into the net.
Chances continued to fall for both sides as the half developed, with Ivaro Cejudo twice coming close for Osasuna, while Kennedy struck wide for the home side after 65 minutes.
Osasuna ran away with the match in the latter stages, however, as Cejudo made it 2-1 after 68 minutes, before Garcia headed in his own penalty, which had been saved, to move into a 3-1 lead.
Racing did secure a consolation late on when Jairo Bustara converted from close range, but it was too little too late as Riversio then made it 4-2.
Osasuna have finished the season in seventh place.