The Turkish army says it has no plans to stage a coup against President Recep Tayyip Erdogan and has threatened legal action against anyone who suggests otherwise.

The rare statement aims to squash speculation over the possibility of a military coup in Turkey as the president visits the United States. The military said on its website such "baseless news" was hurting morale in its ranks without naming specific publications.

The Turkish army, historically seen as a defender of secular principles, has ousted three elected governments and one prime minister.

The institution saw its power reduced through a series of measures after Erdogan came to power as prime minister in 2003. Now the country's president, Erdogan is due to return to Turkey on Sunday.