The State Department's legal adviser on Thursday offered up the Obama administration's legal justification for the killing of Osama bin Laden.

In a blog post on the law site, Opinio Juris Harold Koh said the killing was justified under the 2001 Authorization for Use of Military Force (AUMF) because bin Laden was the leader of al Qaeda, a terrorist group that had "not abandoned its intent to attack the United States, and indeed continues to attack us.”

In an earlier speech, which he cited in his blog post, Koh had said individuals who are members of "an armed group of belligerents" are "lawful targets" under international law.

"Given bin Laden’s unquestioned leadership position within al Qaeda and his clear continuing operational role, there can be no question that he was the leader of an enemy force and a legitimate target in our armed conflict with al Qaeda," Koh wrote.

U.S. Navy SEALs killed bin Laden in a May 2 raid on a compound about 40 miles from Islamabad, where the al Qaeda founder had been hiding. Since then, some have questioned whether his killing was legal under international law.

Koh added that "materials" the Navy SEALs found during the operation are proof that bin Laden posed an immediate national security threat.

"In addition, bin Laden continued to pose an imminent threat to the United States that engaged our right to use force, a threat that materials seized during the raid have only further documented," Koh wrote. "Under these circumstances, there is no question that he presented a lawful target for the use of lethal force."

Koh wrote that "great pains" were taken to ensure no civilians were unnecessarily harmed in the raid.

He also said U.S. forces were ready to capture bin Laden if he had safely surrendered.

"Finally, consistent with the laws of armed conflict and U.S. military doctrine, the U.S. forces were prepared to capture bin Laden if he had surrendered in a way that they could safely accept," Koh continued.

Koh's justification came the same day President Obama made a major speech on U.S. policy in the Middle East in which he said al Qaeda was “losing its struggle for relevance.”

Read Koh's blog post here.