'Merlin's beard, keep it down!'
-- Hagrid's reaction to Hermione's scream (OP20)
A mild oath used to express surprise or exasperation
The phrase "Merlin's beard", a mild form of swearing exclusive to the wizarding world, first appeared in the Daily Prophet, when Glinda Crook was interviewed about the new Hallowe'en restrictions (DP4).
The words escaped from Amos Diggory when he first met Harry Potter with the Weasley family (GF6).
It appeared most frequently during the events in OP. Arthur Weasley seemed quite fond of the phrase (OP7, OP9, OP24), and it was also spoken by Hagrid (OP20), Dumbledore (OP27) and Cornelius Fudge (OP36).
In HBP, Cornelius Fudge likely confused the Muggle Prime Minister when he included it their conversation about the then current crisis (HBP1). Professor Slughorn said it when he encountered Harry in the grounds of Hogwarts (HBP22) and also when surprised by Tom Riddle's questions about horcruxes in the past (HBP23).
When Auntie Muriel saw Xenophilius Lovegood wearing an inappropriate yellow outfit at the Weasley wedding she also used this phrase (DH8).
Regarding the first occurence, although the date printed on DP4 is 1 October 1999, the timeframe for those events was 1992-93. GF was not published until July 2000 and covered the school year of 1994-95.