The 24-year-old international, who has been capped 15 times, has spent the last two seasons with United Arab Emirates side Al Sharjah, and joins the Pamplona outfit on a free transfer.
Shojaei, an attacking midfielder, is looking forward to linking up with compatriot Javad Nekounam.
"I was one of the best players in the UAE and want to be the best in Spain alongside my team-mate Javad Nekounam. I will undoubtedly learn more from him. We can strengthen Osasuna's midfield together," he added.