Michel Aoun said on Friday that he ordered action be taken about it at the time.
But he said he had no authority over the facility.
“Do you know how many problems have been accumulating?” Mr Aoun replied when a reporter pressed whether he should have followed up on his order.
His comments are the most senior confirmation that Lebanon’s leaders and security officials were aware of the 2,750 tons of highly explosive ammonium nitrate that had been stored at the port for years.
The chemicals exploded on Tuesday after apparently being set off by a fire.
The huge blast killed nearly 150 people, wounded thousands and caused billions of pounds of damage across the city.
Bodies were still being recovered from the rubble on Friday.
Investigators probing the blast have focused on personnel at the Port of Beirut.
The material had been there for seven years, since 2013
Mr Aoun, who has been in his post since 2016, said previous governments had known about the danger of the stockpile since it was confiscated from a ship impounded in 2013.
“The material had been there for seven years, since 2013,” he told a news conference.
“It has been there and they said it is dangerous and I am not responsible.
“I don’t know where it was placed. I don’t even know the level of danger.”
He said when he was told of the stockpile June 20, he immediately ordered military and security officials “to do what is needed”.
Mr Aoun said the explosion may have been caused by negligence but the investigation will also look at the possibility that it could have been caused by a bomb or other “external intervention”.
He said he has asked France for satellite imagery from the time of the blast to see if they showed any planes or missiles.
So far, 16 port employees have been detained and others questioned.
Official letters circulating online showed the head of the customs department had warned repeatedly over the years that the ammonium nitrate in the port was a danger and had asked judicial officials for a ruling on how to remove it.
Three days after the explosion, it is still not clear what exactly ignited the chemicals.
Meanwhile, rescue teams found four more bodies in the wrecked port in the last 24 hours.
The explosion has also devastated nearby residential neighbourhoods, blowing out windows and wrecking facades for miles around.
French and Russian rescue teams with dogs searched the port area Friday, a day after French President Emmanuel Macron visited the site, promising aid while demanding reform from Lebanon’s long-entrenched political leaders.
An initial government assessment said 300,000 people – more than 12% of Beirut’s population – had to leave homes damaged or left uninhabitable by the explosion.
Mr Macron said France will lead international efforts to provide aid but will not give “blank cheques to a system that no longer has the trust of its people”.
France, which has close ties to its former colony, has also sent a team of 22 investigators to help probe the cause of the blast.
Based on information from Lebanon so far, French forensic police official Dominique Abbenanti said the explosion “appears to be an accident” but it is too early to say for sure.
French investigators are involved at the request of Lebanon and also because one French citizen was killed and at least 40 were injured in the blast.
French police could later question witnesses or suspects, Eric Berot, chief of a unit involved in the investigation, said.
For now, the French team is dividing up zones to cover with their Lebanese counterparts and will use drones to study the area.
The UN human rights office has called for an independent investigation, insisting “victims’ calls for accountability must be heard”.