WASHINGTON — Before his sudden firing last week, the Pentagon official who oversaw military commission trials at Guantánamo Bay was exploring potential plea deals to end the long-delayed prosecution of five suspects in the Sept. 11 attacks, a move that would foreclose the possibility of execution, according to several people familiar with the matter.

No deal was imminent, the people said, but the talks were active and contemplated the defendants — including Khalid Shaikh Mohammed, the self-described architect of the attacks — pleading guilty and probably receiving life sentences. Most of the people spoke on the condition of anonymity to discuss sensitive deliberations.

The Pentagon has refused to explain the moves in public, and it provided no rationale to the men when they were handed one-paragraph letters notifying them of their dismissal, one person said.

It is not clear whether the settlement talks prompted the Trump administration’s abrupt ouster on Monday of the official, Harvey Rishikof, who was the military commission system’s so-called convening authority. His legal adviser, Gary Brown, was simultaneously fired.