Vettel beat Mercedes driver Valtteri Bottas by .041 seconds in the second session under floodlights, having been comfortably ahead of Red Bull's Daniel Ricciardo during the roasting-hot first practice in the early afternoon.

Ricciardo was third in P2, followed by Ferrari's Kimi Raikkonen. Mercedes' Lewis Hamilton was fifth.

"In race trim (Ferrari) seem a couple of tenths quicker, so I'm expecting a great battle tomorrow and then again on Sunday," Hamilton said.

Ferrari was quick despite problems. Raikkonen was hit by engine trouble in P1 and Vettel ground to a halt with about 40 minutes left in P2 due to a "complete shutdown." Vettel was in the lead at that point, and still had time to go back out late in the session.

"We still need to improve the car. On one lap it was OK," Vettel said. "(On a) long run we might be quite a bit behind, but I am sure we can improve for tomorrow."

During P2, Hamilton had to take evasive action to avoid hitting Nico Hulkenberg's slow-moving Renault on a corner.

"These drivers are so dangerous, man," Hamilton lamented over the radio to his engineer.

Hamilton and Vettel are level on points in the title race with a first and second place each. Vettel won the season-opening Australian GP and Hamilton, who has secured both pole positions, won in China last weekend.

In the first practice, Hamilton saved his pace and did not push for a leading time.

The second session, which started at 6 p.m. local time (1500 GMT) was in considerably cooler temperatures and closer to the conditions expected in Saturday's qualifying, which comes after a third practice run. Sunday's race also starts at 6 p.m.

When drivers took to their cars at 2 p.m. for P1, the track temperature was 46 degrees (115 F). Red Bull's Max Verstappen was third in that, Hamilton 10th, and Bottas 14th.

"It was incredibly hot early on, with some of the very toughest conditions, both physically and in terms of working with the tires," Hamilton said. "Then it was much cooler, giving us a much better representation of what qualifying and the race will be like."

Raikkonen's session ended early after his Ferrari sustained engine damage before he completed a timed lap.

He pulled over, climbed out with his helmet still on and started walking back to the paddock despite the intense desert heat. Raikkonen, whose nickname is "Iceman," eventually hitched a lift the rest of the way on a scooter. Meanwhile, Ferrari said the car problem was overheating in the turbo area.