The Japanese Supreme Court has upheld a law that married couples must have the same surname, in a blow to women's rights activists.
Campaigners have said the law was discriminatory as most couples end 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 a separate law that stops women remarrying within six months of a divorce unconstitutional.
Both sets of laws date back to Japan's 19th Century Meiji era.
Judge Itsuro Terada noted that among the Japanese there was already informal use of maiden names, 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 in the past 40 years which show that more than 96% of Japanese couples opt for the husband's surname.
The surname case was brought by three individual women and one couple in a civil partnership, who argued that the law was unconstitutional, discriminatory and archaic.
Two lower courts have already ruled against them and public opinion on the questions was split.
Women in Japan were traditionally able to retain their maiden names after marriage, until 1898 when 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 a legal challenge to a law that states women cannot remarry within six months of divorce.
The law was originally intended to help determine the paternity of a child born shortly after the 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.