The British Geographical Survey (BGS) said the epicentre was 20km (12 miles) north of Swansea, measuring between 4.4 and 4.9 on the Richter scale - at a depth of 7.4km (4.6m).
A BGS tweet added: “Events of this magnitude only happen in the UK every 3-5 years.”
People across south Wales and south west England said they felt what they thought was an earthquake this afternoon.
James Leonard wrote on Twitter: “Wow was that an earthquake in Swansea my house just shook #earthquake earthquake.”
Mark Wyatt, a third year student at Cardiff University, was entering his house in the city centre when he heard a “weird, deep rumbling sound” around 2.30pm.
The 21-year-old said: “We heard the noises before we felt the rumble, and then the house shook for a couple of seconds before it stopped.”
Tremors were felt across the Bristol Channel into England too.
Seth Piper wrote on Twitter: “OK pretty sure I just experienced my first ever earthquake ... in Bristol, UK?”
LAst year, an earthquake measuring 3.8 on the Richter scale was felt in the Highlands - the strongest in the region since 1986.