(CNN) More than a million Turks united in Istanbul on Sunday night as part of a pro-democracy rally following last month's failed coup.

The massive demonstration, dubbed the "Democracy and Martyrs' Rally," was held at a parade ground in Turkey's biggest city and saw both supporters of Turkish President Recep Tayyip Erdogan's AKP party and opposition parties gather.

There, in a sea of red Turkish flags, they expressed support for the democratic process, rejecting a return to the country's restive past, when military coups were commonplace.

Erdogan also reiterated his willingness to reinstate the death penalty as part of a post-coup realignment of the country's laws.

During the rally he said that despite the opposition of the European Union, the people of Turkey supported capital punishment -- meaning that he had a mandate to sign it into the law.

The parade ground in Turkey's largest city, built to hold more than a million people, was a sea of red.

Government, opposition read from same page

JUST WATCHED The names and faces of Turkey's media crackdown Replay More Videos ... MUST WATCH The names and faces of Turkey's media crackdown 07:52

In an unprecedented show of unity, leaders and supporters of the opposition Nationalist Movement Party (MHP) and Republican People's Party (CHP) joined Erdogan supporters in light of the failed takeover attempt.

CHP leader Kemal Kilicdaroglu said that the bloody coup attempt, which claimed 239 lives and injured nearly 2,200 others, was the beginning of a new era of compromise.

"Post July 15, now there is a new Turkey. If we can carry this power and the culture of reconciliation even further, we will leave a better Turkey for our children," he told the crowd, according to Turkish state media.

Hundreds of thousands of people gathered in Istanbul for a pro-democracy rally organised by the ruling party, bringing to an end three weeks of demonstrations.

The message of leaders' and other speakers' speeches were clear -- thanking the Turkish population for standing up for the concept of democracy.

JUST WATCHED On GPS: Who is behind the attempted coup in Turkey? Replay More Videos ... MUST WATCH On GPS: Who is behind the attempted coup in Turkey? 01:32

Prime Minister Binali Yildirim said that the takeover attempt had unified the country. "Every coup which does not kill us, makes us stronger. Just like here and now," he said

Erdogan said the coup's architects "made a lot of sinister calculations but miss something. The faith and determination of this nation." The president lays the blame at the feet of Fethullah Gulen, a one-time ally but now fierce critic who lives in self-imposed exile in the US.

Over a million gathered to support a democratic Turkey, following the failed takeover attempt.

Erdogan himself came out and thanked people repeatedly for taking to the streets on the night of the coup to demonstrate against the army factions that were attempting to wrest power from the elected government -- it was ultimately the president's ability to rally the masses that night that allowed his government to stay in power.

He likened the coup plotters to "terrorists wearing military uniforms."

Photos: Failed military coup in Turkey Police try to stop people from attacking a judge, suspected in the failed coup plot, in Erzurum, Turkey on Tuesday, July 19. Turkey has fired or suspended about 50,000 people as the government intensifies a crackdown following last weekend's failed coup attempt. Teachers, journalists, police and judges have been affected. Hide Caption 1 of 39 Photos: Failed military coup in Turkey Police escort Turkish soldiers, accused of taking part in the attempted coup, as they leave a courthouse in Istanbul's Bakirkoy neighborhood on Saturday, July 16. Hide Caption 2 of 39 Photos: Failed military coup in Turkey Turkish police officers cover the eyes of soldiers as they are transported in a bus from the courthouse in Istanbul on July 16. Hide Caption 3 of 39 Photos: Failed military coup in Turkey Akin Ozturk, front row, center, a four-star general and former commander of the Turkish air force, is among those in police custody whom President Recep Tayyip Erdogan's government has accused of having led the failed coup attempt. Hide Caption 4 of 39 Photos: Failed military coup in Turkey In a mass detention in Ankara, dozens of detainees are forced to kneel, partially stripped. Hide Caption 5 of 39 Photos: Failed military coup in Turkey A man waves a Turkish flag from a car roof during a July 16 march around Kizilay Square in Ankara after the attempted military coup. Hide Caption 6 of 39 Photos: Failed military coup in Turkey Damaged vehicles are abundant outside the presidential palace in Ankara on July 16. Hide Caption 7 of 39 Photos: Failed military coup in Turkey People kick and beat a Turkish soldier suspected in the attempted coup on Istanbul's Bosphorus Bridge on July 16. Hide Caption 8 of 39 Photos: Failed military coup in Turkey Women react after people took over a military position on the Bosphorus Bridge in Istanbul. Hide Caption 9 of 39 Photos: Failed military coup in Turkey People gather outside the Turkish Parliament in Ankara during an extraordinary session after the failed coup attempt. Hide Caption 10 of 39 Photos: Failed military coup in Turkey Turkey Prime Minister Binali Yildirim addresses the Turkish Parliament after the failed coup attempt. Hide Caption 11 of 39 Photos: Failed military coup in Turkey A protester rests on a bench as smoke billows from the Turkish military headquarters in Ankara. Hide Caption 12 of 39 Photos: Failed military coup in Turkey People stand under a huge Turkish flag during a march around Kizilay Square in Ankara in reaction to the attempted coup. Hide Caption 13 of 39 Photos: Failed military coup in Turkey Members of the Turkish military surrender on Istanbul's Bosphorus Bridge on after a failed coup attempt. Hide Caption 14 of 39 Photos: Failed military coup in Turkey People protesting against the coup wave a Turkish flag on top of a monument in Istanbul's Taksim Square. Hide Caption 15 of 39 Photos: Failed military coup in Turkey Clothes and weapons belonging to soldiers involved in the coup attempt are scattered on Bosphorus Bridge in Istanbul. Hide Caption 16 of 39 Photos: Failed military coup in Turkey A Turkish police officer in Istanbul embraces a man on a tank in the wake of the violence overnight. Hide Caption 17 of 39 Photos: Failed military coup in Turkey Smoke billows from the direction of the Presidential Palace in Ankara on July 16. Hide Caption 18 of 39 Photos: Failed military coup in Turkey People gather on top of a Turkish military tank in Ankara in the morning after the coup attempt. National intelligence officials said the coup was put down and that the government remains in control. Hide Caption 19 of 39 Photos: Failed military coup in Turkey Turkish people wave national flags from a car in Istanbul. Hide Caption 20 of 39 Photos: Failed military coup in Turkey People gather around a car damaged by a tank in Kizilay Square early on July 16. Hide Caption 21 of 39 Photos: Failed military coup in Turkey People take to the streets near the Fatih Sultan Mehmet Bridge during clashes with military forces in Istanbul. Hide Caption 22 of 39 Photos: Failed military coup in Turkey People escape the clashes in Ankara early Saturday. Hide Caption 23 of 39 Photos: Failed military coup in Turkey Tanks move into position as Turkish citizens attempt to stop them in Ankara. Hide Caption 24 of 39 Photos: Failed military coup in Turkey Citizens in Sivas rush to the streets during the chaotic coup attempt. Hide Caption 25 of 39 Photos: Failed military coup in Turkey A man approaches Turkish military with his hands up at the entrance to the partially closed Bosphorus Bridge in Istanbul. Hide Caption 26 of 39 Photos: Failed military coup in Turkey A wounded man is given medical care at the entrance to the Bosphorus Bridge in Istanbul after clashes with Turkish military. Hide Caption 27 of 39 Photos: Failed military coup in Turkey People react in front of the Justice and Development Party's headquarters in Karabuk. Hide Caption 28 of 39 Photos: Failed military coup in Turkey Soldiers secure an area as supporters of Turkish President Recep Tayyip Erdogan protest in Istanbul's Taksim Square. Hide Caption 29 of 39 Photos: Failed military coup in Turkey Turkish military members make their way through the streets of Istanbul. Hide Caption 30 of 39 Photos: Failed military coup in Turkey Supporters of President Recep Tayyip Erdogan protest in front of soldiers in Istanbul's Taksim Square. Hide Caption 31 of 39 Photos: Failed military coup in Turkey President Recep Tayyip Erdogan speaks on CNN Turk via a FaceTime call in Istanbul after members of the country's military attempted to overthrow the government. Hide Caption 32 of 39 Photos: Failed military coup in Turkey Turkish soldiers block Istanbul's iconic Bosphorus Bridge.

Hide Caption 33 of 39 Photos: Failed military coup in Turkey Turkish security officers detain police officers, seen in black, in Istanbul, during a security shutdown on the Bosphorus Bridge. Hide Caption 34 of 39 Photos: Failed military coup in Turkey A military airplane is seen flying over Turkey. President Recep Tayyip Erdogan urged people to take to the streets and stand up to the military. Hide Caption 35 of 39 Photos: Failed military coup in Turkey People take cover near the Bosphorus Bridge as military airplanes fly overhead. Hide Caption 36 of 39 Photos: Failed military coup in Turkey Turkish soldiers are seen on the Asian side of Istanbul.

Hide Caption 37 of 39 Photos: Failed military coup in Turkey A Turkish security officer stands guard on the side of the road. Hide Caption 38 of 39 Photos: Failed military coup in Turkey Turkish soldiers block Istanbul's Bosphorus Bridge. Hide Caption 39 of 39

Erdogan: I support death penalty

JUST WATCHED Fate of soldiers unknown in wake of Turkey coup attempt Replay More Videos ... MUST WATCH Fate of soldiers unknown in wake of Turkey coup attempt 02:38

Erdogan's government has been emboldened by the support and has seized on the post-coup momentum to strengthen its grip on power. On Sunday, he pledged that if parliament approved the reintroduction death penalty he would enthusiastically sign it into law.

"Sovereignty belongs to the nation. Without any condition. Since you are demanding the death penalty, the authority that will decide on this is the great Turkish national assembly," he said in his speech to the huge crowd.

"After our parliament takes such a decision the step to be taken is apparent. If it comes to my approval I hereby express that I will approve it."

Turkish President Recep Tayyip Erdogan speaking in Instanbul during a rally against the failed military coup on July 15.

European Union leaders have previously stated that if Turkey were to reintroduce the death penalty, it would effectively end the country's application to join the bloc.

However Erdogan seemed unfazed: "In Europe they say there is no death penalty but there is the death penalty in America, Japan, China and most of the world."

Turkey has received criticism for what it did after the coup, where it conducted massive arrest campaigns, detaining thousands of individuals from the military, schools and universities, health services and the media.

Erdogan's government has attempted to justify its heavy-handed actions by insinuating that the Gulen movement -- the followers of the aging cleric -- is behind the failed coup has infiltrated these different institutions.