JOHANNESBURG — Spain’s place among world football’s all-time greatest teams was assured today when Andres Iniesta scored with four minutes of extra time remaining to beat the Netherlands 1-0 and clinch his country’s first World Cup.

With the teams facing a penalty shootout in a game of few clear chances, Iniesta collected a sliding pass into the area from substitute Cesc Fabregas and smashed the ball across goalkeeper Maarten Stekelenburg and in at the far post.

The goal ended an often ill-tempered match and made Spain only the third team to be world and European champion at the same time.

At the final whistle, the Spanish players hurried to swap their blue shirts for their more familiar red colors in time to collect the trophy. They donned shirts decorated with a single gold star to mark their triumph, becoming the eighth nation to receive the honor.

The Dutch players trudged forlornly to collect their runners-up medals, the third squad from the Netherlands to finish second in football’s biggest game.

The teams created few clear chances in normal time at Soccer City but the game opened up slightly after a cagey opening hour in which the Netherlands broke up Spain’s attempts to get its famous passing game going with physical play that brought the Dutch eight yellow cards.

Defender John Heitinga got a red card in the 19th minute of extra time to become only the fifth man to be sent off in a World Cup final.

With Spain also collecting five yellow cards, the final yellow card count beat the previous record of six in the 1986 final between Argentina and West Germany and made the final the dirtiest of all time.

Extra time was littered with almost as many chances as the rest of the game. Stekelenburg saved a low shot by Fabregas before winger Arjen Robben was blocked and defender Joris Mathijsen headed over at the other end.

With Wesley Sneijder closely attended by Spain’s defensive midfielders and Spain striker David Villa continually forced wide in a search for possession, Robben looked the most likely player to put the finishing touch to his team’s otherwise uncompromisingly physical approach.

The winger broke free in the 62nd minute but his low shot to the far post was brilliantly kept out with the toe of goalkeeper Iker Casillas’ right boot.

He was clear again with seven minutes of normal time remaining, collecting Robin van Persie’s flick from Nigel de Jong’s hopeful punt forward. Robben held off Carles Puyol’s attempts to wrestle him to the ground and tried to take the ball across Casillas, only for the goalkeeper to gather it at the forward’s feet.

Villa and Sneijder had few chances to add to their five tournament goals, the latter unable to find his range with free kicks and most notable for the sliding pass between Spain’s central defenders that set Robben free in the 62nd.

Villa went closest in the 70th when Stekelenburg somehow knocked his close-range finish over the bar, shortly before Sergio Ramos headed over the bar while unmarked.

Villa, Sneijder, Uruguay striker Diego Forlan and Germany forward Thomas Mueller remain tied at the top of the tournament scoring charts with five goals from seven matches.