MISURATA, Libya — After 42 years of absolute power in Libya, Col. Muammar el-Qaddafi spent his last days hovering between defiance and delusion, surviving on rice and pasta his guards scrounged from the emptied civilian houses he moved between every few days, according to a senior security official captured with him.

Under siege by the former rebels for weeks, Colonel Qaddafi grew impatient with life on the run in the city of Surt, said the official, Mansour Dhao Ibrahim, the leader of the feared People’s Guard, a network of loyalists, volunteers and informants. “He would say: ‘Why is there no electricity? Why is there no water?’ ”

Mr. Dhao, who stayed close to Colonel Qaddafi throughout the siege, said that he and other aides repeatedly counseled the colonel to leave power or the country, but that the colonel and one of his sons, Muatassim, would not even consider the option.

Still, though some of the colonel’s supporters portrayed him as bellicose to the end and armed at the front lines, he actually did not take part in the fighting, Mr. Dhao said, instead preferring to read or make calls on his satellite phone. “I’m sure not a single shot was fired,” he said.