An unsuccessful attempt to overthrow Turkish President Recep Tayyip Erdogan has caught the country and the world by surprise. Questions remain as to who was truly behind the coup carried out by a group of middle-rank military and law enforcement officers and whether it was a well-planned operation, considering how quickly it failed.

Semyon Bagdasarov, Director of the Moscow-based Center for Middle Eastern and Central Asian Studies, told RT that there was a lot of bad blood between Erdogan and the armed forces. The Turkish strongman has been trying to weaken the army's influence in the country from the moment he came to power. And he largely succeeded.

"Erdogan has long hated the military. When he served as the mayor of Istanbul, the military put him in jail for incitement of ethnic hatred. When Erdogan [became the prime minister], the first thing he did was to hold a referendum in order to amend the Turkish constitution," he said.

Bagdasarov was referring to the 2010 national plebiscite that abolished Provisional Article 15 of the Constitution that provided protection to coup plotters. Hundreds of military personnel, including generals, have been tried under Erdogan, the analyst added.

For their part, the Turkish Armed Forces have been increasingly discontent with the Islamist-leaning trend in the country. At the same time, Islamic cleric Fethullah Gülen, once a key Erdogan ally, and his movement, known as Hizmet, "has never wielded influence on the military," Bagdasarov noted.

Erdogan has promptly pinned the blame for the Friday coup on Gülen, but the reclusive former imam has been influential with the law enforcement, the judiciary and partly intellectuals, not the army. As a result, coup plotters were able to receive support from a few military officers. In other words, not nearly as much as they needed to succeed. To a certain extent, this is why they failed.

Those who wanted to remove Erdogan from power on Friday "went all in without proper preparations," the analyst said. "But they did not have enough power. This is what happened."

Defense analyst Viktor Murakhovsky, the editor of the Arsenal Otechestva (the Armory of the Fatherland) military magazine, shared these sentiments. In his view, the army, at least its leaders, were not behind the coup.

"I would not say that the military made a stand against Erdogan," he told RT. "Unlike four successful post-WWII coups, this insurrection was not based on a military structure, but instead on a political platform that was backed by three-four dozen officers."

These people, the expert added, did not control the military and did not understand what needed to be done to take over the country.

"This was not a planned action, but rather a spur-of-the-moment event," Murakhovsky observed.