Two hotels in a western Japanese city have been reprimanded after refusing to rent a room to a gay couple despite a law that bans turning away guests because of sexual orientation or gender identity, a city official said Monday.

The official said the couple was rejected by two so-called love hotels, accommodations for couples typically booked by the hour, in Amagasaki, Hyogo Prefecture, on May 5. Two days later, one of the rejected customers consulted the city.

City officials visited the hotels and told the operators to ensure that a case like this never happens again.

The operator of one of the hotels accepted the order. However, the other said the couple was turned down "not because they were of the same gender," but for a different reason that the city declined to reveal, according to the official.

There are currently 51 municipalities across Japan, including Amagasaki, which issue certificates recognizing same-sex partnerships as being equivalent to marriage, according to Out Japan Co., which handles consulting and marketing related to sexual minorities.

"We'll continue to enlighten the hotel business in the city not to make those of sexual minorities feel discomfort," the city official said.

The health ministry banned hotels and inns from refusing any guests because of sexual orientation or gender identity in an amended guideline under the hotel business law in January 2018.