Beijing regards Taiwan as a renegade province, ineligible for state-to-state relations and to be taken back by force if necessary. The sensitivity of the issue was underlined last month when China protested after U.S. President-elect Donald Trump accepted a congratulatory phone call from the president of the island.
On Wednesday, after meeting his Chinese counterpart Wang Yi in Abuja, Nigerian Foreign Minister Geoffrey Onyeama was quoted by state news agency NAN as saying: "Taiwan will not have any diplomatic representation in Nigeria and also they will be moving to Lagos, to the extent that they function as a trade mission with a skeletal staff."
NAN quoted Wang as saying China planned to invest $40 billion in Nigeria, in addition to current projects already worth more than that amount.
A statement on the Chinese foreign ministry's website said the two sides had agreed to stick to Beijing's "one China" policy, that Taiwan is a part of China.
Nigeria's presidency issued a statement on Thursday in which it said media reports that Nigeria had cut ties with Taiwan were incorrect.
"The correct position is that the official relationship between Nigeria and Taiwan has been at the level of trade representation and this has not changed from what it used to be," said a statement by the president's spokesman, Garba Shehu.
The emailed statement did not refer to Taiwan being asked to move its Abuja office.
Taiwan has 21 formal allies, only two in Africa. Last month, former African ally Sao Tome switched its diplomatic recognition from Taiwan to China.
In countries with which Taiwan has no formal diplomatic relations it often sets up trade and commerce offices, in capitals and major cities.
While economic ties between the mainland and Taiwan have grown considerably in recent years, their relations have worsened since Tsai Ing-wen, who heads a pro-independence party, was elected president of the island last year.