The British Geological Survey (BGS) said the 3.7 magnitude quake happened at 23:59 GMT on Friday and was 1.8 miles (3km) under the Earth’s surface.
The epicentre was north of Brynmawr, Blaenau Gwent, and west of Crickhowell, Powys, but people on Twitter reported feeling it as far away as Birmingham.
Gwent Police said it received multiple calls overnight but it was “business as usual” for the force.
BBC journalist Alex Humphreys said she felt the “mini earthquake” in Cardiff, 30 miles (50km) away.
“My whole bed shook,” she tweeted. Others described it as a “scary” experience.
Brian Baptie, BGS head of seismology, said it was the largest earthquake in south Wales since a 4.6 magnitude quake about 25 miles (40km) west, near Swansea, in February 2018.
He added that, on average, Britain only gets about one earthquake with a magnitude of 3.7 or greater each year.
The largest earthquake ever recorded in the UK was in the North Sea on 7 June 1931, with a magnitude of 6.1.
The epicentre was in the Dogger Bank area, 75 miles (120km) north-east of Great Yarmouth, Norfolk.
Wales’ most powerful quake was on the Llyn Peninsula, Gwynedd, in 1984 – measuring 5.4, it began at a depth of more than 12 miles (20km).
The BGS said smaller quakes were not unusual in Wales, with 70 measuring more than 3.5 between 1727 and 1984.
A 5.2 magnitude earthquake in Swansea in 1906 was one of the most damaging British earthquakes of the 20th Century, with damage to chimneys and walls reported across south Wales. A seismograph shows the force and duration of Friday night’s quake
Listeners told BBC Radio Wales Breakfast that they felt the “earth shake” in Ebbw Vale, which brought people out of their homes and into the streets.
Robert Griffiths, from Rhiwbina, Cardiff, said he had just sat down to watch TV after a night out when “all of a sudden the whole house shook”.
“The ceiling creaked, we immediately turned the television off and thought ‘what on Earth was that?’
“It was kind of like 20 trucks had driven in front of the house so it was most unusual and quite strange.”
Stephanie Palfrey from Blackrock, near Abergavenny, said she “thought the mountain right behind the house was sliding down”.
“Other villagers came out of their homes to see what the noise was,” she said.
“We live in an old cottage. You could hear it rattling. It was quite something.” The British Geological Survey said the quake’s epicentre was just north of Brynmawr and west of Crickhowell
Geoffrey Davies described an “almighty bang” at Llangattock, near Crickhowell.
“Initially we didn’t know what to think. It was the sort of bang I had never heard,” he added.
“When someone says ‘it shook you to the core’, it was that kind of feeling.”
Elsewhere, Cat said she “thought we were going mad” in Blaenavon, Torfaen, as her “bed and house shook side to side”.
Dr Ian Stimpson, a senior geologist at Keele University, in Newcastle-under-Lyme, Staffordshire, said such events “happen relatively infrequently” in the UK.
“They are a big shock. An earthquake of this size, probably the UK has about three of them a year on average,” he said.
“These earthquakes are way smaller than the Turkish earthquake for example – that was a million times more powerful than the earthquake last night.”