DES MOINES, Iowa (AP)  A man facing federal firearms charges in Iowa who attempted to escape prosecution by fleeing to Cuba has entered plea agreements with U.S. prosecutors.

Court records say Shawn Michael Wegmann signed agreements last week to plead guilty to charges of being a felon in possession of firearms and possession of stolen firearms and to a charge of failure to appear after pre-trial release.

Wegmann, 38, faces up to 40 years in prison and fines of up to $1 million on four firearms counts. He faces up to five years in prison on the failure to appear charge. The plea agreements indicate he will be credited for taking responsibility in both cases, which means a judge may impose sentences that are less than the maximums.

Sentencing is scheduled for June 17.

His attorney in the firearms case declined to comment on the plea deal. His attorney in the failure to appear case did not immediately respond to a message seeking comment on that agreement.

Wegmann was the first fugitive to be returned to the United States by the Cuban government after fleeing to Cuba since diplomatic relations began nearly a year ago, U.S. Marshal Amos Rojas Jr. said.

Wegmann admits that he participated in burglaries in January and February of 2015 in Long Grove, Iowa; Bennett, Iowa; and Morrison, Illinois, during which 38 guns were stolen, including rifles, shotguns and a revolver.

Because Wegmann had previous felony convictions, including burglary in 1996, he was barred from possessing guns.

Four other convicted felons prohibited from possessing weapons also have been indicted for the gun thefts.

Wegmann was originally indicted on the firearms charges in July 2015 and was arrested in August. After a court appearance, he was released to live with his wife in Kirklin, Indiana, under federal parole officer supervision and was required to wear a GPS-equipped ankle monitor.

On Oct. 23, two days before Wegmann was to appear for a court hearing in Davenport, Iowa, in which he was to enter a plea agreement, he disappeared. Officers found his ankle monitor attached to the bumper of a van in the parking lot of a Sam”s Club store in Lafayette, Indiana.

Investigators say he arrived about a week later in Havana in boat reported stolen from a marina in Key West, Florida. Cuban authorities notified the U.S. Marshals Service on Nov. 3 that Wegmann was in their custody. Fingerprinting revealed he was wanted in Iowa.

On Dec. 8, Wegmann was expelled from Cuba and arrested by U.S. marshals.

Rojas, with the U.S. Marshals Service, told the South Florida Sun Sentinel that Cuban immigration authorities “were just amazed that he actually survived” crossing the 230 miles of Florida Straits in the little boat with a 40-horsepower motor.