This is probably the first rule in the playbook of any dictator, whenever some opposition is sensed, as a preemptive strike, the dictator claims publicly that some wicked foreign power wants to remove him from power, so that any identifiable opponents should be considered as evil foreign agents, who must be punished for their treason.
There have been a huge number of examples of this behavior during the last century, in many countries.
1. Military and espionage are largely credited for getting him into power. [1]
2. The US cut military aid and mention his comments specifically. [2]
3. His fall is believed to be the result of his loss of support from the military. [1]
As I see it, the US basically has a shaky relationship with the Sharif family that does most of what the US wants but also recognize they will lose local trust. These conflicts allowed him to have temporary power.