Two army generals, a ruling coalition MP and an opposition MP had been arrested over the alleged plot, the officials added.
A "small group" conspired for four months, the officials said.
Chad, a staunch ally of France, has a long history of coups and revolts.
Mr Deby himself seized power in a coup in 1990.
The BBC's Nathalie Magnien in N'Djamena says it is business as usual in the capital and no-one seems particularly concerned about the news.
There is no visible sign of increased security in the city or patrols on the streets, she says.
"Between four and eight people were killed in fighting at a military barracks in the east of N'Djamena," said a police source who requested anonymity, Reuters news agency reports.
By Celeste HicksFormer BBC Chad correspondent
Chadians are used to news of suspected coups - power has never changed hands peacefully and President Idriss Deby Itno is constantly aware that a soldier or even someone in his own family could overthrow him.
It is not yet clear who was behind this "attempt at destabilisation". Government sources say the main figure arrested is Saleh Makki, a hitherto relatively unknown member of the political opposition with no association with rebels in the past.
Some are speculating that there may be a connection to Chad's recent military interventions abroad and President Deby recently accused Libya of supporting militias against him. Recent threats from the former Chadian rebel group UFR do not carry much weight as they are a spent force.
What is known is that it is very difficult for the opposition to win an election - weak and divided they boycotted the 2011 presidential vote which Mr Deby won with 83%.
Mr Deby changed the constitution to abolish presidential term limits in 2005.
Police sources told the AFP news agency a shoot-out took place on the outskirts of N'Djamena, with three members of the security forces being among the dead.
"A small group of ill-intentioned individuals attempted to carry out a destabilisation plot against the institutions of the republic," a government statement said.
It said that the country's security forces "neutralised" them, without specifying how many people were involved in the alleged action.
Prosecutor Mahamat Saleh Youssouf named the generals who had been arrested as Weiddig Assi Assoue and Ngomine Beadmadji David.
Ruling coalition MP Mahamat Malloum and opposition MP Saleh Makki had also been arrested, he said.
Mr Makki's coalition Co-ordination of Political Parties for the Defence of the Constitution (CPDC), told the BBC it was confused by his arrest.
Mr Makki was arrested by police between 21:00 and 22:00 local time on Wednesday evening, his wife told the CPDC.
Our reporter says it is not clear what charges they will face.
Since its independence from France in 1960, Chad's history has been marked by instability and violence stemming mostly from tension between the mainly Arab-Muslim north and the predominantly Christian and animist south.
Mr Deby has survived two attacks on the capital - in 2006 and 2008 - from rebels in eastern Chad.
These rebels were supported by Sudan's government, which was unhappy that Darfuri rebels were using eastern Chad as a base. But a rapprochement between Chad and Sudan in 2010 has helped bring peace to that region.
Earlier this year, Chad deployed some 2,000 troops to help French forces oust Islamists who had seized large swathes of territory in Mali.
France said it had noted the latest events in Chad "with concern" and called on the government and opposition to engage in  "calm and constructive dialogue", AFP reports.
At least four people were killed in Chad's capital, N'Djamena, as government forces foiled a "destabilisation plot" against President Idriss Deby, officials said.