Updated

Turkish officials say an attempted coup by a segment of the military over the weekend was put down in about 10-12 hours. At least 260 people were killed, and 1,400 wounded in violence that rattled the country's two major cities. Bombs hit the parliament and other state buildings, tanks drove over civilians and there was an attempted assassination of the country's strongman, Recep Tayyip Erdogan.

Here is what is known about how it unfolded, beginning Friday, and why it failed.

___

FRIDAY AFTERNOON

Around 4 p.m. Turkish national intelligence flagged to the chief of staff that they had intercepted communications among a number of military personnel indicating that a coup was planned. With many of the military's senior officers attending a wedding and the president vacationing at a seaside resort, and while a military shake-up was imminent, the coup plotters felt it was an opportune time to strike.

A former Turkish military officer, now a security analyst, Metin Gurcan, wrote that the top brass decided to move to avert a coup by closing airspace and forbidding military units from leaving their barracks. Sensing that their moves were detected and getting wind of the meeting of loyal officers, the coup plotters moved up their plans from later that evening. Ibrahim Kalin, Erdogan's spokesman, said the plotters kidnapped Gen. Hulusi Akar, the chief of military staff, after he learned of the suspicious activities.

Gurcan said the soldiers leading the coup relied on WhatsApp to communicate commands and coordinate moves. Family members of soldiers detained after the coup attempt told reporters the soldiers thought they were being sent to training.

___

FRIDAY EVENING

At around 10 p.m., there were reports that traffic was blocked one way on the Bosporus bridge. Gulnur Aybet, a professor at an Istanbul academy, said she was heading home on a busy Friday night when she saw tanks deployed on the bridge. It was a shocking sight, she said: "I felt violated." In the capital Ankara, military jets swooped over the city and reports emerged of gunfire at the military headquarters in Ankara.

By 11 p.m., Prime Minister Binali Yildirim, an Erdogan loyalist speaking by telephone on TV, said there was an attempted coup but that it wouldn't succeed in interrupting democracy.

Shortly after, a TV announcer on state television TRT read a statement by the coup plotters who referred to themselves as the "Peace at Home Committee," a reference to famous words of national founder and former army officer Mustafa Kemal Ataturk: "Peace at home, peace in the world."

The plotters declared a curfew and vowed to protect freedoms. It was learned later that military personnel had stormed TRT stations in Ankara and Istanbul, forcing the broadcaster in Ankara to read the statement. TRT staff in Istanbul said about 40 soldiers, including at least one officer, stormed their building, forcing them to go home.

Ben Said, executive producer for TRT World, said the soldiers told the staff they were there to protect them from Islamic State militants.

At around 11:30 p.m., explosions are heard at the police special forces training headquarters just outside of Ankara as jets start attacking it, killing 47 officers. The explosions damaged the roof of one building and tore down its front wall, exposing dust-covered bunk beds. A second building was riddled with bullet fire from helicopters.

Jets also attacked the headquarters of the national satellite station, the national intelligence building and the Ankara police department, where seven police officers were killed. Military officers called TV stations to declare they didn't support the attempted coup.

State media later reported that F-16s took off from Diyarbakir Air Base that night after telling personnel on duty that the pilots were called for a mission against Kurdish rebels in northern Iraq. Erdogan said that power was cut at other military bases, including Incirlik, used by the U.S.-led coalition to bomb IS militants, to prevent renegade flights.

Just around midnight, Erdogan called a private TV station, CNN Turk, through FaceTime, and urging the public to come out and defend Turkey. "We will overcome this," he said. Citizens received messages on their mobile phones urging them to go out in the streets. Mosques used their loudspeakers to urge people to go out to the streets, which many did.

___

EARLY HOURS OF SATURDAY

Legislators rushed to the Turkish Grand National Assembly to oppose the coup attempt. The building was hit by three bombs, injuring 14 security guards. "As soon as parliament became active (in opposing the coup) it became a target of the bombs," said Irfan Neziroglu, the parliament's secretary-general. The legislators descended into a shelter at around 3 a.m.

Gunshots and violence were also reported in Istanbul. Images emerged of protesters climbing over tanks, soldiers shooting into crowds and tanks driving over civilians to break up crowds.

Meanwhile, prosecutors launched an investigation into the attempt and declared soldiers taking part in the coup would be arrested. The first arrests began at around 2 a.m. TRT television was liberated, soldiers who stormed it were detained and the station resumed broadcasts.

Days after the coup, Erdogan and his aides revealed details of a commando raid on the beach resort where the president had been vacationing with his family.

Kalin, his spokesman, said intelligence also revealed that three helicopters were heading toward the resort in Marmaris, prompting Erdogan to evacuate. The commandos, nearly 30 of them, arrived half an hour after the president and his family departed. The commandos went room-to-room looking for Erdogan. Clashes ensued and at least one of Erdogan's guards was killed. Erdogan told CNN two days after that night that he survived only by minutes.

Turkish officials accused the movement of the U.S.-based cleric Fethullah Gulen of being behind the coup. Gulen has denied it.

Shortly after 3 a.m., Erdogan arrived in Istanbul airport and was greeted by thousands of supporters. He later told CNN that the renegade soldiers had seized the communication towers in Istanbul airport, and that they flew F-16 jets overhead when he landed there.

___

SATURDAY MORNING

Reports said a military helicopter used to attack Turksat satellite television was brought down at around 6 a.m., while two explosions were heard near Erdogan's palace in Ankara. Soldiers who held the Bosporus Bridge are seen surrendering.

Two hours later, Akar was freed from captivity at an air base on the outskirts of Ankara.

At around 10 a.m., about 700 soldiers surrendered and left military headquarters.

___

SATURDAY AFTERNOON

The government launched a widespread crackdown on officials believed to be linked to Gulen, purging 2,745 judges and other judicial officials.

Prime Minister Binali Yildirim addressed parliament, reading out a poem that constitutes the words of the Turkish national anthem.

___

DAYS LATER

State media said an aide to Turkish military chief, Lt. Col. Levent Turkkan, allegedly told interrogators the coup failed because Akar refused an offer to lead the attempt.

___

Suzan Fraser reported from Ankara.