The funeral was held at the San Manuel Amphitheater in San Bernardino and was attended by thousands of law enforcement officers.
MacKay had been with the San Bernardino County Sheriff's Department for 15 years. The 35-year-old leaves behind a wife and two children. The detective was the last person allegedly killed by Dorner in the shootout at an Angelus Oaks mountain cabin.
MacKay was a bagpipe player who often participated in funeral services for fellow fallen members of law enforcement who died in the line of duty. At the beginning of the service, 103 bagpipe players performed on stage in front of thousands of law enforcement officers.
Members of law enforcement gathered from all over the country and civilians also came out to pay their respects.
"I just felt like I needed to pay my respects to someone that was in a bad situation and this is what's happened to him and his family. I think it's a tragedy and I can only imagine what this family is going through and the loss that they're feeling," said area resident Tracy Stamp.
You can watch the funeral live on ABC7 or streaming live on abc7.com.
MacKay was born and raised in Lake Arrowhead. He attended Calvary Chapel Christian School in Twin Peaks, Mary P. Henck Intermediate School in Lake Arrowhead and Rim of the World High School, where he played tennis and football. MacKay was also very involved with the youth group at Church of the Woods.
Loved ones describe MacKay as a dedicated family man.
Among the speakers were San Bernardino County Sheriff John McMahon, MacKay's best friend Deputy Roger Loftis and MacKay's father, Alan MacKay.
Dorner is an ex-Los Angeles Police Department officer and former Navy reservist who was wanted for killing Cal State Fullerton assistant basketball coach Monica Quan and her fianc? Keith Lawrence. In addition to MacKay, Dorner is also suspected of killing Riverside Police Officer Michael Crain in an ambush shooting.
Following Dorner's last stand, the Angelus Oaks cabin went up in flames. Charred remains found inside the cabin were positively identified as Dorner.
An autopsy revealed Dorner died from a single gunshot wound to his head, which appeared to be self-inflicted.