WASHINGTON — Members of the NATO alliance have sternly warned the rebels in Libya not to attack civilians as they push against the government of Col. Muammar el-Qaddafi, according to senior military and government officials.

As NATO takes over control of airstrikes in Libya, and the Obama administration considers new steps to tip the balance of power there, the coalition has told the rebels that if they endanger civilians, they will not be shielded from possible bombardment by NATO planes and missiles, just as the government’s forces have been punished.

“We’ve been conveying a message to the rebels that we will be compelled to defend civilians, whether pro-Qaddafi or pro-opposition,” said a senior Obama administration official. “We are working very hard behind the scenes with the rebels so we don’t confront a situation where we face a decision to strike the rebels to defend civilians.”

The warnings, and intense consultations within the NATO-led coalition over its rules for attacking anyone who endangers innocent civilians, come at a time when the civil war in Libya is becoming ever more chaotic, and the battle lines ever less distinct. They raise a fundamental question that the military is now grappling with: who in Libya is a civilian?