Date: 201501
Local time of day: 1201-1800
Location: ZZZZ.Airport, FO
Flight conditions: VMC
Weather elements / visibility: Rain
Light: Daylight
Aircraft: B777 Undifferentiated or Other Model
Operator: Air Carrier
Operating under: Part 121
Flight plan: IFR
Mission: Passenger
Flight phase: Parked
ATC / advisory: Ground ZZZZ
Aircraft component: Electrical Distribution
Component problem: Malfunctioning
Reporter organization: Air Carrier
Reporter function: Captain; Pilot Flying
Reporter qualification: Flight Crew Air Transport Pilot (ATP)
Human factors: Other / Unknown; Troubleshooting; Confusion
Second reporter function: First Officer
Anomaly: Aircraft Equipment Problem Less Severe; Flight Deck / Cabin / Aircraft Event Smoke / Fire / Fumes / Odor; Ground Event / Encounter Other / Unknown
Detector: Person Flight Crew; Person Ground Personnel
When detected: Aircraft In Service At Gate
Result: General Evacuated; General Maintenance Action
Contributing factors: Environment - Non Weather Related; Aircraft
Primary problem: Aircraft

Narrative: Upon arriving at the gate; external power was applied to and accepted. I shut down the APU and completed the termination checklist. Approximately 2 minutes after external power was applied we; the pilots on flight deck; heard a series of disconnects and popping sounds and a total loss of external power occurred within 10 seconds. I tried to restart the APU again yet it was not out of it's cool down cycle after initial; normal parking shutdown sequence and a fault in the APU start was annunciated. In less than a minute; about 30 seconds; the flight deck was completely engulfed in thick; black; toxic smoke and fumes.As I saw the intrusion of the smoke; I ordered the flight deck crew out of the flight deck. I then opened the flight deck windows to evacuate the smoke and fumes and realized that the situation was intensifying and that I was in danger of becoming incapacitated. I then left for the forward Flight Attendant (FA) communications station at door 1L and made a PA throughout the aircraft for an evacuation through the main door only as we only had a few remaining passengers on board (less than 20) and the entire crew left on the aircraft to evacuate. In less than 30 seconds everyone hurriedly left the 1L exit. I further ensured everyone was off the aircraft.While I was making the cabin evacuation assessment a Maintenance Technician circled round me and was now on the flight deck in the captain's seat assessing this situation. I returned to the flight deck and the smoke had dissipated considerably yet I heard the technician coughing repeatedly. I stood upright and over the main throttle console. My breathing too was labored so I dawned the jump seat O2 mask and selected 100% pressure breathing. I motioned to the Maintenance Technician to dawn his mask and he shook his hand to indicate no. He did not speak to me in English and I do not speak his language. He then tested the fire system and we had a forward cargo fire light illuminate. From my disadvantage view; I could not tell if he had pressed the extinguisher or not. By his actions; I assumed he was now taking control of the flight deck. During this time the lead FA; came to the flight deck dawned with a PBE and both a water and Halon fire extinguisher. I told him not to use the water one as it was inappropriate for electric fires and that there was no evidence of a fire on the flight deck and he would further damage the flight deck electronics and equipment. If the agents of the Halon extinguisher were to be used. I asked him to leave the flight deck. His total time on the flight deck was less than 30 seconds.Fire and rescue arrived within a minute of the start of the event and a ground agent foamed the external receptacle with a Halon extinguisher as depicted in a video available for review. The fire/ rescue team further foamed the external power connection outlets and nose gear area. As the Maintenance Technician continued his series of system tests on the aircraft systems; I felt there was nothing more for me to do and I left the aircraft in the control of Maintenance and fire/rescue and station management. I when out to the ramp area and stayed away from personal yet I took pictures and immediately forwarded them with an email to the Operations Manager. The Manager de-briefed me in my hotel room about 2 hours after the event. Substantial damage to the external power connection point is obvious and visible in the photos while other electric damage internally to wiring and components may have been substantially compromised and will need to be thoroughly evaluated before the aircraft can be returned to service.


Second narrative: [Report narrative contained no additional information.]


Synopsis: A B-777 air crew experienced a total loss of electrical power after external electrical power had been applied to the aircraft. In less than a minute; the flight deck was completely engulfed in thick; black; toxic smoke and fumes. They evacuated the aircraft along with the few remaining passengers.