Updated

By Larry Fine

NEW YORK (Reuters) - Fourth seed Jelena Jankovic of Serbia narrowly averted a first-round upset by rallying to beat unseeded Romanian teenager Simona Halep 6-4 4-6 7-5 at the U.S. Open on Tuesday.

The 18-year-old Halep, ranked 96th in the world, was two points from registering the first major upset of the championships serving at 5-4 in the third set before Jankovic broke her serve with a forehand winner to level the set.

Jankovic, who reached the Open final two years ago but has been hampered by an ankle injury in recent months, won the next two games and ended the tussle by breaking Halep at love -- the 15th service break of the match in windy conditions on Arthur Ashe center court.

"It was really a tough match," Jankovic said in an on-court interview. "I had to get used to conditions. It was quite windy here and I was a little bit nervous to be honest, so I'm very happy to get through."

Both Jankovic and Halep committed seven double faults in the two-hour 20-minute match.

Jankovic, who played only four hardcourt matches in three tournaments in the run-up to the Open, made an uncharacteristic 48 unforced errors against the Romanian, who engaged her in many long rallies until appearing to tire at the end.

"I injured my ankle and I was not able to train and play," explained Jankovic, who fell to Serena Williams in the 2008 U.S. Open final. "Hopefully I can get better in each match.

"Hopefully, I'll play with more confidence, go after my shots and make less errors. Today I was a little rusty."

Halep made a superb showing in her U.S. Open debut despite failing to qualify in Cincinnati, Montreal and New Haven leading up to the tournament.

However, Jankovic stepped up her game and a fatigued Halep had no more answers despite a valiant effort.

Former world number one Jankovic next plays Croatian qualifier Mirjana Lucic, who eliminated Australian Alicia Molik.

(Reporting by Larry Fine; Editing by Frank Pingue)