In three hours of thunderstorms on Tuesday, lightning flashed close to 5,000 times in the city, according to the Hong Kong Observatory.

This included Hong Kong's 18th highest occurrence of cloud-to-ground lightning detected in a hour since records began in 2005, as heavy rain pelted down after a week of sweltering temperatures.

According to Li Yuet-sim, acting senior scientific officer of the Observatory, cloud-to-ground lightning was recorded 4,884 times between 11am and 1.59pm.

A total of 3,242 instances of cloud-to-ground lightning were detected between noon and 12.59pm, which is the 18th highest in an hour since records began, Li said.

She added that the highest was about 13,000 cloud-to-ground lightning strikes in an hour, recorded on September 9, 2010.

An amber rainstorm warning signal was issued between 12.30pm and 1.30pm, while a thunderstorm warning was in force 11.00am to 3.30pm.

An amber alert means that heavy rain has fallen or is expected to fall generally over Hong Kong, exceeding 30mm in an hour, and is likely to continue.

Thundery showers around noon brought more than 30mm of rainfall to the urban areas and New Territories East, and more than 50mm over Sai Kung and Tseung Kwan O on Tuesday.

The Observatory explained that a broad trough of low pressure brought showers and thunderstorms to the coast of Guangdong and the northern part of the South China Sea.

The local weather authority forecast Tuesday night's weather to be cloudy with occasional showers and a few squally thunderstorms as of 4.45pm.

The Observatory also said a broad trough of low pressure would bring thundery showers to the coast of Guangdong and the northern part of South China Sea in the next couple of days and the trough was expected to linger around the northern part of the South China Sea in the latter part of this week.

As such, the Observatory forecast there would be a few showers in the following few days, with the showers being heavy at times on Wednesday.

The city was hit by a whopping 10,000 bolts of lightning during an epic 12-hour overnight thunderstorm in July.