Nishiyama Onsen Keiunkan is the oldest company in the world. Founded in 705 A.D., the Japanese hot spring hotel has operated continually for an astonishing 1,300 years. Think about it: this company has existed since before Charlemagne became the first emperor of the Holy Roman Empire.

The company’s founder, Fujiwara Mahito, was the son of a close aide to Emperor Tenji, Japan’s 38th emperor, and he built the hotel in a mountainous village in Hayakawa, Yamanashi Prefecture. It’s said that some of the most famous shoguns and samurai soaked in the hot springs there, so that when you go for a dip, you’re in good historical company.

Having survived a mind-blowing 52 generations of successive ownership within the same family, the hotel is no doubt a study on how to achieve longevity in business. Learn these three vital lessons from the hotel on building a business that lasts.

Put Your Employees First, Ahead of Growth and Shareholders

As of just a few years ago, Nishiyama Onsen Keiunkan wasn’t the oldest company in the world, another Japanese company was. Kongo Gumi was founded in 578. In the business of construction, Kongo Gumi mainly focused on building Buddhist temples. But in 2006 — after a 1,428-year run — Kongo Gumi met its abrupt end because it broke one of the fundamental laws of longevity.

Kongo Gumi’s business started with Buddhist temples and eventually grew to include commercial buildings and even coffins during the rough times of World War II. Through fourteen centuries, the company survived and thrived. What did the company in was the boisterous bubble economy of the 1980s.

During this time, in a bout of excessive exuberance, the company borrowed heavily to invest in real estate. But when the bubble burst in the 1992-1993 recession, the company’s real estate holdings shrank in value. Then by 1998, demand for temple-building declined sharply. In 2006, the end had arrived — the company’s “borrowings had ballooned to $343 million and it was no longer possible to service the debt.” Kongo Gumi was no more, and Takamatsu, a larger construction company, acquired its assets and made it a subsidiary.

In contrast, Nishiyama Onsen Keiunkan is a company that put its employees first, ahead of shareholder interests and growth. They never tried to open numerous branches and build a hotel chain. The numbers bear this out: “89.4% of the companies with more than 100 years of history are businesses employing fewer than 300 people.”

Making growth a priority is anathema to long-term survival. Small companies survive.

Not only has the same family run the hotel for 52 generations, there are families among the staff who have held the same post for generations. That’s why they run the business in the spirit of service, as a way to earn wages and protect the hotel — not as a way to profit.

Find Stability, but Be Flexible

The hotel business is one of the oldest in the world. In fact, most of the oldest businesses in the world are hotels, breweries, pubs, or restaurants. Finding an industry with relative stability is essential for building a company that lasts.

Nintendo is a prime example. You may not realize it, but the company is 125 years old and long pre-dates their 1985 video game console. Founded as a card company back in 1889, Nintendo’s first product was a playing card game called Hanafuda. With the success of their handmade cards, they quickly moved into mass-producing playing cards and that’s what they focused on until 1956.

But beginning in 1956, the company began struggling because of the limitations in the playing card market. In 1964, the playing card market crashed and Nintendo stock tumbled from 900 yen to 60 yen.

That’s the kind of market shock that kills companies, and Nintendo’s run could have ended their if they hadn’t been flexible. They realized that playing cards were just a type of toy. They applied the experience they had making playing cards to toys and found success. Eventually, making toys eventually led them to making electronics and then video games.

Rather than living and dying with the playing card trend, Nintendo was flexible in how it interpreted its industry and value, and it found longer-term stability in applying creativity to making games — and there will always be a market for products that are fun.

Dedicate Yourself to Service

Of the 5,586 companies in the world older than 200 years, a startling 56% percent of them, or 3,146 companies, are Japanese. The next-highest country is Germany with 837 companies, about a quarter of that of Japan.

It’s Japan’s unique dedication to service that sets it apart. Intergenerational patronage takes the concept of the repeat customer to its extreme and it’s the lifeblood of a company that’s existed for centuries.

It’s natural then that Japanese companies that last have focused on serving the domestic Japanese market. For Nishiyama Onsen Keiunkan, that’s meant focusing locally and in their own community, where their repeat customers lived. That’s how the hotel became much loved by “Kyoto residents, military leaders, and the literati”—and its reputation grew from there.

While it’s hard to quantify the quality of service in Japan, compare the western saying, “the customer is king” to its Japanese counterpart: “the customer is god.”

* * *

Today, the average lifespan of a company in the S&P 500 is a shockingly-low 15 years. In an age when corporate turnover is higher than ever, we could learn a thing or two from companies that have lasted nearly a hundred times as long.

Nishiyama Onsen Keiunkan is the best example of what’s such a powerful idea in Japan that it has a name: shinise means “established and long-standing company” in Japanese. The lessons above point to the broader philosophy about building companies that shinise companies share—it’s not about building something big, it’s about building something remarkable, that lasts.