Authorities in Thailand have arrested a man they believe is the main suspect in a bombing at a shrine in Bangkok two weeks ago that killed 20 people.

Prime minister Prayuth Chan-ocha said the man is a foreigner and was arrested in eastern Thailand near the Cambodian border.

He described him as the main person in the bombing but did not directly say he is suspected of actually planting the bomb.

He said officials knew from their investigation that people involved in the bombing were about to flee the country and had traced the man to the Aranyaprathet district in Sa Kaeo, a major crossing point to Cambodia.

The prime minister described the man as a piece in a jigsaw puzzle that would connect various parts of the case, which included a bombing the day after the shrine blast that exploded harmlessly in the river next to a busy Bangkok pier.

Security officials on Saturday arrested a man during a raid on a Bangkok apartment that contained some bomb-making materials, and Thai military authorities have been interrogating him.

He has been linked to the shrine bombing, but the authorities have not yet released his name or nationality. Arrest warrants were issued on Monday for two more suspects, a Thai woman and a man of unknown nationality.

It was not immediately known if the arrested man is the person who was seen in a security video wearing a yellow T-shirt and leaving a backpack at the shrine shortly before the blast.

The PM said it would be great if the suspect is the man they are seeking: "So we will know who they are, where they came from, who's behind this."

He said: "Don't say just yet it's about this and that. It could affect international affairs. We have to do a lot of tests, fingerprints. If he is the guy, he is the guy."

The blast at the Erawan Shrine was unprecedented in the Thai capital, where smaller bombs have been employed in domestic political violence over the past decade, but not in an effort to cause large-scale casualties.