WASHINGTON — Two men have been charged in the United States with conspiring to help overthrow the government of the tiny West African nation of Gambia, federal prosecutors said Monday.

Both men, U.S. citizens of Gambian descent, remain in federal custody after court appearances Monday in Baltimore and Minneapolis.

The charges stem from a Dec. 30 coup attempt in the former British colony, which came as the longtime ruler was away. Gambian President Yahya Jammeh, who has since returned to the capital, blamed “terrorist groups” for the coup attempt and alleged that plotters had received backing from foreign countries.

Prosecutors say the two men, Cherno Njie and Papa Faal, traveled separately from the U.S. to Gambia to participate in the unrest there. They later returned to the U.S., where they were charged with weapons violations and with violating a law that makes it illegal to take military action against a country with whom the U.S. is “at peace.”

Faal, 46, a dual citizen of the U.S. and Gambia who lives in Minnesota, told investigators that in August he joined a group of fighters in the United States bent on overthrowing the government. He said he was motivated to be part of the group out of concern that elections were being rigged and for “the plight of the Gambian people,” according to court papers.

Human rights activists have long criticized the government in Gambia, a small nation bordered by Senegal, for targeting political opponents, journalists, and gays and lesbians.

Faal told the authorities that the group was composed of men of Gambian descent who primarily lived in the U.S. and Germany, and most had military experience.

As part of the preparations, he purchased semi-automatic rifles in Minnesota that were then shipped by cargo ship to Gambia.

After group members were defeated in a raid on the State House, Faal escaped by ferry to neighboring Senegal.

Prosecutors allege that Faal identified Njie, a 57-year-old citizen of Gambian descent who lives in Austin, Texas, as one of the financiers and leaders of the coup.

Njie was arrested Saturday after flying into Dulles International Airport from Senegal. At a brief court appearance Monday in Baltimore, he agreed to remain in custody and be transported to Minnesota to face charges.