They just couldn’t keep a lid on it.

Two women stashed nearly 2 kilos of cocaine beneath their hairpieces and weaves in a bid to smuggle the drugs through Kennedy Airport — but were busted after wigging out at Customs, officials said yesterday.

The powdered cocaine was found resting on each of the women’s scalps — camouflaged by the artificial hair and encased in form-fitting plastic packages, authorities said.

The pair was arrested Sunday after walking off Caribbean Airlines Flight 526 from Georgetown, Guyana.

Officials said they became suspicious when the duo started acting nervously as they approached the airport Customs checkpoint.

When the women were then patted down for potential contraband, officers felt the bulges on their heads, authorities said.

The women were taken to the airport’s medical facility, where health workers removed their wigs and weaves and found the drugs.

Kiana Howell was carrying 996 grams of cocaine under her wig, while Makeeba Graham had another 1,046 grams of cocaine under her hairpiece, officials said.

Both of the women are now facing drug-smuggling charges in Brooklyn federal court.