India on Thursday test-fired a nuclear-capable intermediate-range ballistic missile which can reach the Chinese cities of Beijing and Shanghai, defence officials said.