This game was the basis for Super Mario Bros. 2 (1988) in the USA, after Nintendo of America had rejected the Japanese sequel, Super Mario Bros.: The Lost Levels (1986), which they considered too similar to the first game, Super Mario Bros. (1985), and too challenging for the American fanbase. The actual sequel was released years later outside Japan as "The Lost Levels" segment of Super Mario All-Stars (1993).
Re-developed and repackaged a year later in the U.S. as Super Mario Bros. 2 (1988), replacing all the playable main characters with Mario, Luigi, Peach and Toad. The original game had already been created by largely the same team that had also made Super Mario Bros. (1985), including music from composer Koji Kondo, so it already had many similar elements, and required some minor adjustments to make it appear like a Super Mario game while leaving most of the game's assets (worlds, enemies and items) unchanged.
The game was inspired by The Dream Factory, a summer festival that took place in Osaka and Tokyo in July-August 1987. The festival promoted several Fuji Television Company shows, one of them being a cartoon featuring the festival's mascots, the Dream Factory Family. Fuji then approached Nintendo for a video game that would tie in with the cartoon. The festival's emphasis on Italian masks is reflected in the prominence of masks in the game (as throwable objects, portals, etc.). Nintendo was later able to re-design the game as Super Mario Bros. 2 (1988) by replacing the playable characters Imajin, Mama, Lina and Papa into Mario, Luigi, Princess Toadstool and Toad, because Fuji didn't own the rights to Doki Doki Panic, only the characters.