Super Mario Run will be released in Apple's App Store in December in more than 100 countries.
It will be free to download but users will have to pay for the full game.
Nintendo, which announced the tie-up at Apple's launch event for the iPhone 7, saw its shares jump 18% before falling back to around a 13% rise.
Smartphones are the gaming industry's fastest growing source of revenue and Nintendo has been criticised for being slow on the uptake.
However, the Japanese firm co-created the popular Pokemon Go game and released an app called Miitomo earlier this year. It plans to unveil more gaming titles by March 2017.
Super Mario creator Shigeru Miyamoto said an Android version would also be launched at a later date.
The evolution of Super Mario
- Super Mario Bros was created as a sequel to Donkey Kong. It is the most successful video game series of all time.
- Mario is an Italian-American plumber and has a younger brother called Luigi.
- He was originally a carpenter.
- In the game he has to navigate a series of levels, avoid enemies and collect coins along the way.
At the Apple launch event, Mr Miyamoto said to loud cheers from the audience, "Mario is running toward his next goal: iPhone."
Mobile analyst Jack Kent, of IHS Markit, said: "Mario is one of Nintendo's core properties so it makes sense for it to come to iPhone, if Nintendo is serious about making a success of its mobile strategy."
Apple is also jumping on the popularity of online gaming.
Gaming phenomenon Pokemon Go will appear on the Apple Watch for the first time. The device will vibrate when users are near Pokemon or Pokestops.