Security procedures are under review after hoax calls were made to GCHQ, during which a number for the eavesdropping agency's boss was disclosed, and to Downing Street, which connected the caller to David Cameron.
The Prime Minister ended the call when it became clear it was a prank, and Downing Street said no sensitive information was disclosed.
A review into the breach is under way at both Number 10 and GCHQ, where a mobile phone number for director Robert Hannigan was revealed to the caller.
A Government spokesman said: "Following two hoax calls to Government departments today, a notice has gone out to all departments to be on the alert for such calls.
"In the first instance, a call was made to GCHQ which resulted in the disclosure of a mobile phone number for the director.
"The mobile phone number provided is never used for calls involving classified information.
"In the second instance, a hoax caller claiming to be the GCHQ director was connected to the Prime Minister.
"Both GCHQ and Number 10 take security seriously and both are currently reviewing procedures following these hoax calls to ensure that the Government learns any lessons from this incident."
It is not known if the same person was behind both hoaxes, but a man claiming responsibility for the call to GCHQ described his actions to The Sun newspaper.
He claimed he was high on drink and drugs at the time and said the situation was "hilarious".
"I've just made complete monkeys out of GCHQ. I've got the mobile number of the director," he told the paper. "What's more, I am off my face on booze and cocaine."
He added: "I'm definitely going to do it again. It was so easy."
The paper reported that the man telephoned Mr Hannigan claiming to be an ITN journalist, but said the director was suspicious and ended the call.
The mobile phone number for Mr Hannigan is understood to be for an unclassified phone, rather than one of the secure lines used for sensitive communications.
The call to Mr Cameron was made to an official mobile, but the conversation was understood to have been "quite brief".
Originally published 25/01/2015