The eruption occurred near Fagradalsfjall, a mountain on the Reykjanes Peninsula, around 30 km (19 miles) southwest of the capital.
Some four hours after the initial eruption at 2045 GMT - the first on the peninsula since the 12th century - lava covered about one square kilometer or nearly 200 football fields.
More than 40,000 earthquakes have occurred on the peninsula in the past four weeks, a huge jump from the 1,000-3,000 earthquakes registered each year since 2014.
The eruption posed no immediate danger to people in Grindavik or to critical infrastructure, according to the Icelandic Meteorological Office (IMO), which classified the eruption as small.
Residents in the town of Thorlakshofn, east of the eruption site, were told to stay indoors to avoid exposure to volcanic gases, Iceland's Department of Civil Protection and Emergency Management said. The wind was blowing from the west.
Unlike the eruption in 2010 of the Eyjafjallajökull volcano, which halted approximately 900,000 flights and forced hundreds of Icelanders from their homes, this eruption is not expected to spew much ash or smoke into the atmosphere.
Located between the Eurasian and the North American tectonic plates, among the largest on the planet, Iceland is a seismic and volcanic hot spot as the two plates move in opposite directions.
The number of quakes had slowed down in recent days, however, leading geologists to say that an eruption would be less likely.
Reykjavik's international Keflavik airport was not closed following the eruption, but each airline had to decide if it wanted to fly or not, IMO said.
Arrivals and departures on the airport's website showed no disruptions.