NEW YORK (AP) Ernests Gulbis became the first man seeded in the top 20 at this year's U.S. Open to lose, blowing a two-set lead in the second round Friday against his pal and frequent practice partner, 45th-ranked Dominic Thiem of Austria.

Thiem won 4-6, 3-6, 6-4, 6-3, 6-3 in a match between players who share a coach, Gunter Bresnik.

This was the first match of Thiem's career that went five sets. At 20, he is the younger player ranked in the top 50.

He'll now be making his debut in the third round of a Grand Slam tournament, facing 19th-seeded Feliciano Lopez of Spain next.

Gulbis, who beat Roger Federer on the way to his first major semifinal at the French Open, made nearly twice as many unforced errors as Thiem, 78-41.