Mr Giles becomes Australia's first Indigenous head of government, after the Country Liberal party room voted 11-5 to remove Mr Mills.
The ousted chief minister was in Japan at the time and was given the news by phone.
The move comes after months of leadership speculation.
Darren Mara has the details.
Terry Mills led the Country Liberal Party to a strong victory in last year's Northern Territory elections.
But in the months since the August vote, his popularity - and that of the CLP - had dropped dramatically.
The 40-year-old Adam Giles says he was approached by his party colleagues to replace Mr Mills, an offer he was happy to accept.
"Can I say I am truly humbled to be asked by my colleauges to undertake this role. It is a significant challenge to take the leadership of the Northern Territory in the times we're in at the moment and I look forward to that role. I think there is a great message to sell by the Country Liberal Party and I look forward to selling that message and taking us forward into the future, not only with my deputy leader-elect, Dave Tollner, but also my parliamentary colleagues and my Cabinet which will be sworn in tomorrow afternoon."
CLP President Ross Connolly says there'd been a substantial shift in support away from Mr Mills in the parliamentary wing of the party in recent days.
And he's told the ABC that led to the leadership spill.
"As you would understand it's the parliamentary wing's job to elect its leader not the party's role, so I wouldn't have expected to have been consulted along the way on that. I'm simply hoping that with this change we can enter a period of consolidation and getting on with some good work of government and put an end to the internal stuff that's been taking everybody's attention for a week or two."
But it wasn't the first challenge to Terry Mills' leadership.
Only last week, Mr Mills admitted that Mr Giles had challenged for his job at a marathon meeting of CLP MPs.
Federal Labor's Northern Territory MP, Warren Snowdon, says the successive attempts to topple Mr Mills have badly eroded confidence in the CLP government.
On a positive note, Mr Giles has made history, becoming the first Indigenous head of government in Australia.
But Mr Snowdon says that while it's a significant event for Mr Giles, it isn't relevant to the day's events.
He's told Sky News the dumping of Terry Mills was a backhanded manouvre.
"It's a circus and a palace coup. The chief minister is away, the minister for transport is away, the treasurer and attorney-general are in Canberra today talking to government ministers."
Law lecturer at Charles Darwin University, Ken Parish, says Terry Mills became a lame duck leader despite unexpectedly leading the CLP to a strong election victory.
He says Terry Mills has worn the blame for recent unpopular government economic policies.
"Probably economically wisely, but politically suicidally, the Mills government introduced some very harsh economic measures, cutting expenditure drastically, cutting the public service - and Darwin is very much a public service town, almost as much as Canberra - raising taxes and charges, especially water and electricity rates. For several months now, the CLP government has been extraordinarily unpopular and people have tended to blame Terry Mills personally."
Political commentator and emeritus professor at Charles Darwin University, David Carment, says the leadership coup probably won't go down well with Territorians.
"I think people will be both perplexed and surprised. It was only about a week ago that the Country Liberal Party parliamentarians met and seemed to have, at least for the time being, sorted out the leadership question and I feel that most Territory residents would have believed that at least for the next few months there would be no further major ructions."
