Japan conceded a late winner to suffer a 4-3 defeat away to Brazil in a women's soccer international friendly on Thursday.

Jun Endo's penalty and a well-taken goal from Mina Tanaka got Nadeshiko Japan level late in the second half, but Priscila Flor floated in the winner for Brazil deep in the stoppage time at Neo Quimica Arena in Sap Paulo.

Japan, eighth in the FIFA rankings, led through Aoba Fujino in the 38th minute when the 19-year-old scored off the bar from inside the box following a Yui Hasegawa layoff. But Beatriz Zaneratto curled in a free-kick from the edge of the area at the other end to bring ninth-ranked Brazil level three minutes later.

Two defensive mistakes cost Japan dearly in the second half, starting with a weak pass from captain Saki Kumagai near the halfway line that allowed Gabrielle Jordao a free run at goal and to eventually score in the 61st minute.

Brazil had its third two minutes later, capitalizing on more casual play in the Japan backline, this time by Moeka Minami, as Zaneratto chipped home.

The visitors mounted a late comeback, starting with Endo burying from the spot in the 86th minute after substitute and 18-year-old debutant Momoko Tanigawa was dragged down.

Forward Tanaka, also off the bench, then steered home a difficult left-footed volley off a cross from right-back Risa Shimizu to draw Japan level two minutes later.

But there was one last twist to the entertaining encounter as Flor's swiftly-taken shot from inside the area flew into the top corner in the dying seconds of additional time.

The two sides meet again on Sunday in another friendly as Japan steps up its preparations for two Paris Olympics qualifying matches against North Korea in February.