The journalists were accused in assisting terrorists after publishing a video that many say prove Turkish intelligence aid has supplied Syria-based terrorists with weapons.
The footage prompted international condemnation as concern was raised about media freedom in Turkey.
"I will remain silent to the decision the court has given. But I don't need to accept it, I want to make that clear. I don't obey or respect the decision," Erdogan told reporters in Istanbul before leaving on an official visit to West Africa.
"This has nothing to do with press freedom. This is a case of spying," he said.
In November 2015, Can Dundar and Erdem Gul were arrested as a result of accusations made by Turkish President Erdogan and the head of the National Intelligence Organization (MIT) after they brought to light MIT's arms deliveries to Syria.
Several weeks after their arrest, Dundar and Gul petitioned the Constitutional Court, arguing claiming their pre-trial detention was unconstitutional.
Despite their release, the two journalists will face life sentences at their trial scheduled to start on March 25 as well as a ban from leaving the country.