SHANGHAI - Ferrari showed it has the speed to challenge Mercedes in the Chinese Grand Prix, with Kimi Raikkonen and Sebastian Vettel setting the two fastest times in practice on Friday.

Raikkonen had the quickest lap time, a 10th of a second ahead of Vettel. The Mercedes cars were just behind the Ferrari pair, with Nico Rosberg third and Lewis Hamilton fourth, both within half a second of Raikkonen.

Ferrari also demonstrated in the first two Formula One grands prix that it had the race pace, if not the qualifying speed, to compete with Mercedes, but suffered engine failures in both races.

Vettel said upon arriving in Shanghai that he believed Ferrari's early season technical issues were behind it and the team had made enough progress over the winter to vie for the constructors' championship.

He sounded upbeat on Friday but cautioned against getting too excited. Ferrari also finished 1-2 in the final practice at the Bahrain GP two weeks ago before Hamilton took the pole and Rosberg won the race — his second victory of the season.

"Friday's not that important in terms of position, it's more in terms of feel," Vettel said. "And the feel was OK, but OK is not good. We can still improve, especially the balance of the car."

Raikkonen was even less pleased with the feel, saying he got decent laps only with the super-soft tires.

"It has been quite a difficult day overall," he said. "I was struggling to get the grip on the tires probably due to the wind. I was sliding a lot."

Ferrari team principal Maurizio Arrivabene also downplayed his team's performance, stressing that Mercedes was still the team to beat.

"I can say that the Mercedes team of this year is the strongest one in the last 10 years," Arrivabene said. "To be able to win against them, you have to work and be better than them."

Mercedes topped the leaderboard in the morning practice despite some troubles. Hamilton spun twice at the same corner, telling his team over the radio, "I keep having this locking into Turn 11." And Rosberg was forced to end his session early with an ignition problem.

"It looks like we are quick here again," Rosberg said. "But in the afternoon we saw that Ferrari are also very quick, so we are definitely looking out for them, and we'll have a bit of homework to do tonight."

Ferrari will have another slight advantage in Sunday's race after Hamilton, the world champion and two-time defending champion in Shanghai, received a five-place grid penalty for an early gearbox change.

Red Bull driver Daniel Ricciardo had the fifth fastest time of the afternoon practice session, followed by Toro Rosso teenager Max Verstappen, Force India's Nico Hulkenberg, Toro Rosso's Carlos Sainz, Force India's Sergio Perez, and Williams' Valtteri Bottas.

McLaren driver Fernando Alonso returned to the track for the first time since his spectacular crash at the Australian GP last month, setting the 11th fastest time.

Alonso's fractured rib ruled him out of the Bahrain GP, but he was provisionally cleared to practice on Friday, and given the green light by doctors to race this weekend.

Williams driver Felipe Massa and Renault driver Kevin Magnussen both had tire issues in the morning session that prevented them from setting a time.

Massa's left rear tire came off the rim as he was going into Turn 5, causing him to spin across the track in a cloud of white smoke. When he returned a short while later, he had another problem with the same tire and was forced to stop again.

Magnussen's left rear tire blew out on the back straight, bringing the red flag out as debris was cleared from the track and halting practice for 20 minutes.

Massa returned for the afternoon session, but Magnussen's car remained in the garage for repairs.