The ART driver passed Trident’s Roman Stanek on the run down to Turn 1, having made a better start.
He quickly built up a solid lead and, despite two safety-car periods, held on to take his third series victory.
Stanek took second place and sits second in the drivers’ standings, resisting challenges from Hitech’s Isack Hadjar and Alexander Smolyar (MP Motorsport), who finished third and fourth respectively.
Martins’s good start put him straight into the lead ahead of poleman Stanek while, further back, Prema Racing’s Ollie Bearman passed team-mate Arthur Leclerc, who also fell behind Caio Collet (MP Motorsport) at the start.
Prema’s Jak Crawford made up two places by Turn 1 to run in seventh.
Hadjar made up a place to take third from Smolyar around the outside of Turn 1 and was close to passing Stanek ahead of him before holding off.
The safety car was deployed on lap four of 24 after Rafael Villagomez and Kush Maini (MP Motorsport) made contact at Turn 12, with the Van Amersfoort Racing driver bouncing across the gravel and into the barrier, ending his race.
Maini received a 10-second penalty for causing the collision.
Racing resumed on lap eight, with Crawford passing Kaylen Frederick for sixth at Turn 1 before Collet followed him through several corners later.
Stanek, Hadjar and Smolyar were embroiled in a tight battle for second by lap 10, with Martins almost a second clear out front.
A second safety car came the following lap after Carlin’s Brad Benavides went into the barriers at Turn 2, telling engineers over the radio he had suffered a mechanical issue.
On the restart, Leclerc made contact with sprint race winner David Vidales, who was forced to run wide at Turn 1, and received a five-second penalty.
He fell to 11th before making it back past Gregoire Saucy (ART) before running wide in a bid to pass Juan Manuel Correa for 10th on the run down to Turn 1 in an incident that will be investigated after the race.
Correa re-passed Leclerc at the chicane while the Monagesque driver tussled with reigning Formula Regional European champion Saucy into the final laps.
Martins was over two seconds clear by the penultimate tour and crossed the line 2.3s ahead of Stanek.
Bearman finished fifth, his second best result of the season so far, with Crawford sixth and Collet seventh.
Franco Colapinto (Van Amersfoort Racing), Frederick and Correa rounded off the top 10, with Saucy 11th.
Formula 3 returns at Silverstone in support of the British Grand Prix from 1-3 July.
F3 Spain: Feature race result