WASHINGTON — The police officer who fatally shot Michael Brown in Ferguson, Mo., two months ago has told investigators that he was pinned in his vehicle and in fear for his life as he struggled over his gun with Mr. Brown, according to government officials briefed on the federal civil rights investigation into the matter.

The officer, Darren Wilson, has told the authorities that during the scuffle, Mr. Brown reached for the gun. It was fired twice in the car, according to forensics tests performed by the Federal Bureau of Investigation. The first bullet struck Mr. Brown in the arm; the second bullet missed.

The forensics tests showed Mr. Brown’s blood on the gun, as well as on the interior door panel and on Officer Wilson’s uniform. Officer Wilson told the authorities that Mr. Brown had punched and scratched him repeatedly, leaving swelling on his face and cuts on his neck.

This is the first public account of Officer Wilson’s testimony to investigators, but it does not explain why, after he emerged from his vehicle, he fired at Mr. Brown multiple times. It contradicts some witness accounts, and it will not calm those who have been demanding to know why an unarmed man was shot a total of six times. Mr. Brown’s death continues to fuel anger and sometimes-violent protests.