CHICAGO-- A 29-year-old man accused of plotting a suicide bombing overseas has agreed to change his plea to guilty, bringing to an end one of the last terrorism trials pending in the city's federal court.

A lawyer for Shaker Masri -- whose plea deal was announced at a Thursday status hearing -- told reporters that the agreement hammered out with his counterparts at the U.S. Attorney's Office was favourable to his client, though he declined to elaborate.

"Suffice to say, there comes a time when the government makes offers that are difficult to refuse in the light of the potential consequences," defence attorney Thomas Durkin said about the deal with prosecutors.

Masri, who was born in Alabama and lived abroad before returning to the U.S. at age 18, was arrested in 2010 before boarding a scheduled flight from Chicago to Los Angeles -- allegedly the first leg of a trip to a training camp for jihadists in Somalia.

In court, attorneys left open the possibility the deal could unravel, but Durkin told U.S. District Judge Sharon Johnson Coleman he was confident enough to cancel the Sept. 12 trial date. Instead, Coleman set July 20 as the day for Masri to change his plea.

None of the government attorneys spoke to reporters after the hearing.

Masri was charged with attempting to provide material support to a violent extremist and trying to offer material support by use of a weapon of mass destruction outside the U.S. Those charges could carry a sentence of several decades in prison.

Several other people accused of terrorism have also cut plea deals recently with the government, short-circuiting the need for trials and promising lesser sentences.

Legal experts say the willingness to work out agreements with prosecutors may reflect the enormous odds terrorism suspects face at trial. Prosecutors almost always win before juries, which gives those charged with terrorism an overwhelming incentive to cut a deal.

Prosecutors also have reasons to avoid trials: Lengthy proceedings are costly, subject their investigations to scrutiny and force them to disclose sensitive documents they would rather keep under seal.

Among those who changed their pleas to guilty before going to trial in Chicago was Sami Samir Hassoun, the Lebanese immigrant accused of placing a backpack he thought held a bomb on a crowded street near Wrigley Field, the Chicago Cubs' stadium.