Japan upset Spain 3-1 in the final to win the Women's Under-20 World Cup for the first time on Friday.

The victory made Japan the first country to hold titles in all three FIFA Women's World Cup age categories after winning the World Cup in 2011 and the U-17 World Cup in 2014.

[Getty/Kyodo]

On Friday at the Stade de la Rabine, Hinata Miyazawa opened the scoring with a well-struck shot from distance in the 38th minute, and second-half goals by Saori Takarada and Fuka Nagano helped Japan pull away from the Spaniards, whom they had lost 1-0 to in the group stages.

"We didn't have an U-20 title so I'm glad we were able to win," said Japan manager Futoshi Ikeda.

"I hope the level of Japanese women's soccer continues to improve, from junior development to senior level," he said.

(Hinata Miyazawa (10) celebrates with her teammates after opening the scoring)[Getty/Kyodo]

Candela Andujar claimed a consolation goal for Spain in the 71st minute.

Takarada, who scored a total of five goals and made three assists in the competition, won the Silver Ball award and Moeka Minami the Bronze Ball.

(Saori Takarada celebrates after putting Japan 2-0 ahead)[Getty/Kyodo]