TRIPOLI, Libya — The deserted royal palace here, hidden behind locked gates and an overgrown garden, stands as a monument to Col. Muammar el-Qaddafi’s virulent rejection of Libya’s monarchy.

Colonel Qaddafi overthrew King Idris, the country’s founding leader, in a 1969 coup, but that was not all. He also abolished the monarchy; scrapped the royal flag; banished or jailed the king’s relatives; and turned the gold-domed palace into office space, a library, and after 2009, a lavish private museum for classical antiquities.

Yet the popular memory of King Idris, who died in Cairo in 1983, has quietly endured in Libya. And now, after Colonel Qaddafi’s own fall and the years of violent turmoil that have followed, the country’s closet royalists have emerged with a radical suggestion: Restore a form of monarchy, at least temporarily, to let Libyans rally behind a respected father figure and begin to rebuild their splintered nation.

The splinters are jagged ones, with rival militias continually scrambling for dominance. In fierce fighting on Tuesday in the eastern city of Benghazi, several crucial neighborhoods changed hands. In the west, Islamic State fighters beheaded 12 officials in the town of Sabratha, where American warplanes bombed an extremist camp last week.