Players will assume the role of either character and compete in events that take place in environments based on the official venues of the Beijing 2008 Olympic Games.
Mario & Sonic at the Olympic Games will be published by Sega across Europe and North America, and by Nintendo in Japan.
"We are thrilled to partner with Nintendo and International Sports Multimedia on this groundbreaking title," said Hisao Oguchi, president and chief operating officer at Sega.
"For the first time, two of the world's greatest games characters come together to compete in the world's greatest sporting event and we couldn't be more excited."
Shigeru Miyamoto, senior managing director and general manager at Nintendo, added: "Mario and Sonic have been respectful rivals since the early days of video games.
"For a long time they have been discussing the possibility of one day competing against each other. Now that they have been given the perfect opportunity to meet at the Olympic Games, we may finally learn who is actually faster."
The game will be developed for the Nintendo Wii and DS platforms and will be available in time for Christmas.
Cotton seedling freezes to death as Chang'e-4 shuts down for the Moon's 14-day lunar night
Fortnite easily out-earns PUBG, Assassin's Creed Odyssey and Red Dead Redemption 2 in 2018
Meteor showers as a service will be visible for about 100 kilometres in all directions
Saturn's rings only formed in the past 100 million years, suggests analysis of Cassini space probe data
New findings contradict conventional belief that Saturn's rings were formed along with the planet about 4.5 billion years ago