The Japanese Supreme Court has upheld a law requiring married couples to have the same surnames, in a blow to women's rights activists.
Campaigners had said the law was discriminatory, as most couples ended up using the husband's surname.
However, the court said the law did not violate the constitution, public broadcaster NHK reported.
It did, however, deem unconstitutional a separate law that stopped women remarrying within six months of a divorce.
Both sets of laws date back to Japan's 19th century Meiji era.
Judge Itsuro Terada noted that there was already informal use of maiden names among the Japanese people, which eased the impact of the surname law.
He said parliamentarians should decide on whether to pass new legislation on separate spousal names.
The Japan Times cited studies over the past 40 years which showed more than 96 percent of Japanese couples opted for the husband's surname.
The surname case was brought by three individual women and one couple in a civil partnership, who argued the law was unconstitutional, discriminatory and archaic.
Two lower courts have already ruled against them and public opinion on the question was split.
Traditionally, Japanese women were able to retain their maiden names after marriage. But, in 1898, the law was enacted as part of a feudal family system where all women and children came under control of the male head of the household.
The system was abolished in 1948 but the surname law has been retained.
Separately, a divorced woman had filed the legal challenge to the law that stated women cannot remarry within six months of divorce.
The law was originally intended to help determine the paternity of a child born shortly after a divorce.
The Supreme Court agreed with her that it was unconstitutional, but in its ruling left room for the possibility of retaining the law with a shorter waiting period.
The two sets of laws were previously debated in the 1990s when a government panel suggested changing them, but were retained unchanged when conservative politicians opposed the move.