'Why are we against the Taliban? Why are we against Afghanistan?' he asked leaders of more than 120 nations attending the annual General Assembly debate.
'If the Taliban wants to make a religious state, okay, like the Vatican. Does the Vatican constitute a danger against us? No,' said the Libyan leader, addressing the 192-member body for the first time in his 40 years in power.
'If the Taliban wants to create an Islamic emirate, who said they are the enemy?' he added.
The Taliban insurgency in Afghanistan is now at its deadliest since a 2001 US-led invasion ousted their extremist regime. Winning the war in Afghanistan is one of the priorities of the new US administration.
Gaddafi went on to attack the United Nations Security Council in his first appearance at the world body criticising it for failing to prevent 65 wars around the world since it was founded in 1945.
Gaddafi's called for reform of the Security Council either by abolishing the veto power of the five permanent members or by expanding with extra member states to make it more representative.
He says it shouldn't be called the Security Council but would be better named the 'terror council'.