Nintendo, the Japanese gaming giant, has always been synonymous with fun for kids, teens, and adults everywhere.

Over the years, the company has created some of the most beloved video game characters, from Donkey Kong to the Super Mario Bros. to Pokémon, which eventually became essential parts of contemporary culture.

The first-ever video game, called “Tennis for Two,” was created by William Higinbotham in 1958. You might assume that the Nintendo company was founded around the same time, but it actually came around much earlier than that.

In September 2017 the company will be 128 years old, as it was founded back in the 19th century. Nintendo actually didn’t start out as a video game company, originally founded to produce “Hanafuda” (flower cards) playing cards in Kyoto, Japan.

Portuguese traders were the first to bring western-style playing cards to Japan in the 16th century. However, when shogun Tokugawa Iemitsu closed Japan to all foreigners and prevented the Japanese from leaving in 1635, he effectively banned foreign playing cards. At the time, gambling was extremely popular among Japanese people, so it wasn’t long before they created their own card set.

The first card set was created for a game known as Unsun Karuta, but it was soon banned by the government for being gambling-oriented. In the late 18th century, a new card game called Hanafuda emerged, which was more government-friendly.

Hanafuda was a popular game in Japan, but it became even more popular thanks to a man named Fusajiro Yamauchi. This 29-year-old entrepreneur founded Nintendo Koppai, a company which manufactured Hanafuda cards from crushed bark. Thanks to the beautiful design and quality of the cards, Nintendo Koppai managed to establish themselves as one the top card companies in Japan, eventually becoming the largest card manufacturer in the country.

Fusajiro Yamauchi retired at the age of 70 and his son-in-law Sekiryo Kaneda took over the business in 1929. He was the head of Nintendo for the next 20 years before he suffered a stroke in 1949 and left the company to his grandson Hiroshi Yamauchi.

Hiroshi was only 21 years old when he became president of Nintendo and had to leave Waseda University to assume the position. Although Hiroshi was very young and inexperienced, over the years that followed he transformed Nintendo from a card-making company into a multibillion-dollar video game publisher.

It was a long way to the top for Hiroshi since he lacked experience and employees often questioned his authority. However, he made a licensing agreement with Walt Disney for his plastic playing cards, which became an instant hit in Japan and brought great profit to Nintendo. Hiroshi used the success to diversify the company and started experimenting in other areas of business, including a taxi service, a love hotel chain, a TV network, and even instant rice.

Hiroshi’s experiments nearly bankrupted the company, and their last chance was to move into the Japanese toy industry. Nintendo is credited with the invention of the Ultra Hand toy, which became hugely popular in Japan and helped the company to establish itself as an industry giant.

Expanding the company into video gaming was the next step. “EVR Race” was the first arcade game designed by Nintendo in 1975, and six years later “Donkey Kong” was born. The Nintendo Entertainment System (NES) was released in 1985 and “Super Mario Bros.” became a global star.

Read another story from us: Hnefatafl: The Game of the Vikings

The Game Boy released in Japan in 1989 was just a tiny part of Nintendo’s success story. Over the decades that followed, the company completely transformed and revolutionized the electronic gaming industry.