WESTBROOK, Maine (AP) — The assailant in an apparent murder-suicide purchased a handgun hours before ambushing his ex-boyfriend in a shooting that followed a breakup, state police said Monday.

Autopsy results confirmed that Matthew Rairdon, 22, of Westbrook, died from gunshot wounds to the head and chest and that Patrick Milliner, 30, of South Portland, died from a single gunshot wound to the head, investigators said.

Milliner bought the gun Friday at Cabela's; the shootings took place early Saturday, just after midnight, in Rairdon's apartment, said Stephen McCausland, spokesman for the Maine Department of Public Safety.

Milliner, who left a rambling post on Facebook, along with a note, was dressed in black and appeared to have ambushed Rairdon as he walked in the door following a late shift at Mercy Hospital, where he was an emergency room nurse, police said.

Rairdon's roommate found the bodies.

Milliner was a new guard at the Maine Correctional Facility in Windham and was attending the correctional guard training program at the Maine Justice Academy. Police were interviewing fellow corrections officers along with workers at Cabela's, McCausland said.