A pigeon suspected of spying for China was released from captivity after Indian officials had detained it.