A race car veered off the track during a competition in Sri Lanka on Sunday and rammed into a crowd of spectators and race officials, killing seven people and injuring 20 others, officials said.

The crash took place during a race in the town of Diyatalawa in the tea-growing central hills, about 180km (110 miles) east of the capital Colombo.

Thousands of spectators were in attendance at the race.

It was not immediately clear what caused the accident.

Police spokesman Nihal Thalduwa said one of the cars veered off the track and crashed into spectators and officials of the event.

Seven people, including four officials, were killed and another 20 were being treated at a hospital, said Mr Thalduwa.

He said three of the injured were in critical condition.

Mr Thalduwa said police have launched an investigation into the accident, which was the 17th out of 24 events scheduled.

The race was suspended after the accident.

About 45,000 spectators had gathered at the race circuit at a Sri Lankan military academy. The event was organised by the Sri Lankan army and Sri Lanka Automobile Sports.