Gambian authorities confirmed on Wednesday that they had foiled a coup by some military officers to oust President Yahya Jammeh from power.