The 44-year-old Mexican, a former striker at the Spanish club, replaces Miguel Angel Lotina who was recently appointed the new coach of Celta Vigo.
Osasuna narrowly avoided relegation last term but finished two points above the drop zone to retain their first division status for the third season running.
"I'm happy for him, he has worked very hard and I hope other (Mexican) coaches and players can access European football", said Mexican defender Rafael Marquez, who plays for Monaco.
Aguirre, who previously coached Mexican sides Pachuca and Atlante during his career, took charge of the national side last year mid-way through their World Cup qualification campaign.
His predecessor Enrique Meza was sacked after defeats against Costa Rica and Honduras.
Aguirre's appointment helped revive the team, and a run of four wins and a draw eventually saw them qualify in second place in their group behind Costa Rica.
Mexico won their opening World Cup match against Croatia 1-0 and could clinch qualification for the second round with a win against Ecuador on Sunday.
They meet Italy in their final group G game on 13 June.