NICE, France — Alvaro Morata scored twice as defending champion Spain cruised to a 3-0 victory over Turkey on Friday to qualify for the knockout stages of the European Championship.

Spain recorded the largest winning margin of the tournament so far with a second victory that left it top of Group D. Turkey’s second defeat leaves it needing to beat the Czech Republic in its last game to have any hope of qualifying.

After squandering a series of chances in an opening 1-0 win over the Czechs, forwards Morata and Manuel “Nolito” Agudo scored goals three minutes apart in the first half to give Spain a decisive 2-0 lead.

“We scored goals, which was something we hadn’t been doing recently, so it was perfect. But we haven’t won anything yet,” coach Vicente del Bosque said.

Morata opened the scoring with a header into the top-right corner off a pass over the top by Nolito in the 34th minute, sending the ball past goalkeeper Volkan Babacan from 12 meters.

An error by the Turkey defense set up the second goal as center-back Mehmet Topal failed to clear Cesc Fabregas’ lobbed pass and instead lobbed it into the path of Nolito, who slid the ball in despite slipping as he took the shot.

advertisement | advertise on newsday

Spain made it 3-0 three minutes into the second half when Andres Iniesta’s through ball found Jordi Alba, who appeared slightly offside in the box, and the Barcelona left-back squared it for Morata to apply a simple finish.

Morata could have scored a hat trick but was forced off the ball in a good position shortly after the hour mark.

“We played a great match against a complicated opponent,” Morata said. “We have to keep winning like this.”

He added: “I’m very happy with the game that the team played, with the goals, and with being here.”

David Silva could have added to Spain’s lead when he had two shots in the space of a minute but one was deflected off target while the other went wide. Gerard Pique, Spain’s scorer in the first game, had an effort from a narrow angle held by Babacan in the 69th.

@Newsday

After starting with an unchanged team from the Czech game, Spain’s 3-0 lead meant that Vicente Del Bosque could start to conserve his top players, and he took off both Silva and Cesc Fabregas with 20 minutes to go.

Turkey had no answer to Spain’s possession game and when chances did come, the execution was poor. The Turks failed to register a single shot on target.

Striker Burak Yilmaz threatened the Spain goal shortly after Morata’s second goal, but his wild shot went high and wide.

Substitute Olcay Sahan charged into the box late on but his first shot was blocked by fellow sub Cesar Azpilicueta and his follow-up hit the side netting.

Spain’s man of the match Iniesta said he was happy with Spain’s form in a campaign that has often been portrayed as a redemption exercise following a group-stage exit at the 2014 World Cup.

advertisement | advertise on newsday

“After the World Cup, it was disappointing for everyone — for the players, for the fans, for the whole country,” he said. “The response that the team in these two games has been very positive. We showed the winning mentality that we have in this squad.”

Turkey’s dissatisfied fans turned on captain Arda Turan, booing him when he played the ball. Coach Fatih Terim criticized the booing and said “it made an impact on our team.” But he was sharply critical of the team himself.

“Today our national team threw in the towel,” he said. “I have never accepted this and I will never accept it...I’m deeply upset.”

Spain remains unbeaten in 14 games at the European Championship, and hasn’t lost since a 1-0 defeat to Portugal in 2004. Spain also hasn’t conceded a goal in the European tournament since its opener in 2012, a 1-1 draw against Italy.

Turkey faces a fine from UEFA after its fans used flares and a smoke bomb in the stands, and repeatedly threw firecrackers onto the field, after the final whistle.

advertisement | advertise on newsday

There were empty seats scattered around the Allianz Riviera from the start and thousands in the crowd departed well before the end as Spain closed out a routine win.

Earlier in Group D, second-place Croatia drew 2-2 with the Czech Republic in a game also marred by Croatian fans throwing flares onto the pitch and fighting in the stands.