Tama the stationmaster, Japan's feline star of a struggling local railway, was mourned by company officials and fans and elevated into a goddess at a funeral Sunday.

The calico cat was appointed stationmaster at the Kishi station in western Japan in 2007. Donning her custom-made stationmaster's cap, Tama quietly sat at the ticket gate welcoming and seeing off passengers. The cat quickly attracted tourists and became world-famous, contributing to the railway company and local economy.

Tama, who had turned 16 in April, died of a heart failure on June 22. During Sunday's Shinto-style funeral at the station where she served, Tama became a goddess. The Shinto religion, indigenous to Japan and practiced by many Japanese, has a variety of gods including animals.

Story continues below advertisement

In one of several portraits decorating the altar, Tama posed in a stationmaster's hat and a dark blue cape. Sake, as well as watermelon, apples, cabbage and other fruits and vegetables were presented to the cat. A stand outside the station was heaped with bouquets, canned tuna and other gifts left by thousands of Tama fans who came to pray from around the country.

Wakayama Electric Railway President Mitsunobu Kojima thanked the cat for her achievement, and said Tama will be enshrined at a nearby cat shrine next month.

Before Tama's arrival, the local Kishigawa Line was near-bankrupt; and the station was unmanned as it had lost its last staff.

Kojima said appointing Tama as stationmaster was initially an excuse to keep the cat at the station.

"But she was really doing her job," he said. The rest was a miracle, and his company's success story also gave hope for dozens of other struggling tiny local train lines, he said.

"Tama-chan really emerged like a saviour, a goddess. It was truly my honour to have been able to work with her," Kojima said in his speech.

During her tenure, Tama had contributed an estimated 1.1 billion yen ($8.9-million) to the local economy, Kojima said.

Story continues below advertisement

Kojima said that when he visited Tama at an animal hospital the day before she died, the cat woke up and reached out to him with her paws, as if asking for a hug, and looked straight into his eyes. He said he told Tama to get well so they can celebrate the cat's upcoming 10th anniversary as a stationmaster, and said the cat responded with a "meow."

Tama is a popular name for cats in Japan, where they are considered spiritual animals. The word could translate as treasure, ball or spirit.

The cat had climbed the corporate ladder from stationmaster to "ultra-stationmaster" and vice-president of the company before receiving the additional title Sunday of "honourable eternal stationmaster."

Tama will be succeeded by another calico cat, Nitama, now an apprentice stationmaster.