BEIJING — Peter Jesper Dahlin, a human rights activist from Sweden detained this month in Beijing on charges of violating national security laws, was to be expelled from China on Monday, the Chinese Ministry of Foreign Affairs said.

“Under questioning,” the ministry said in an emailed statement, Mr. Dahlin had made “a full and frank confession.” The statement said Mr. Dahlin was suspected of “funding criminal activities harmful to China’s national security.”

“Based on China’s relevant laws, China will expel him on Jan. 25,” the ministry statement said.

Margot Wallstrom, the Swedish minister for foreign affairs, said in an emailed statement that she welcomed “that Peter Dahlin has been released and can be reunited with his family in Sweden.”