By Phil Stewart and Idrees Ali

WASHINGTON (Reuters) - President Barack Obama's nominee to lead the U.S. military in Africa on Tuesday backed the idea of gaining greater power to strike Islamic State, including in Libya, which he described as the group's Plan B as it loses territory in Iraq and Syria.

Marine Lieutenant General Thomas Waldhauser told his Senate confirmation hearing that the U.S. military was making preparations for possible military strikes in Libya against the militants.

But Waldhauser noted limitations on the current commander's ability to order strikes against the group in Libya, which require adhering to White House guidance. That differs from the rules of engagement in Iraq or Syria.

Asked by Republican Senator Lindsey Graham whether it would be wise for Obama to give the commander of the Africa Command the authority to go after Islamic State targets in Africa "on your own," Waldhauser said: "It would be wise."

"It would certainly contribute to what we're trying to do inside Libya," he responded.

Islamic State established a presence in several parts of the country from 2014, and has been active between Benghazi and the militant group's coastal stronghold of Sirte, about 380 km (240 miles) to the west.

In recent weeks, however, the ultra-hardline group has retreated into the center of Sirte after forces aligned with Libya's U.N.-backed unity government advanced from the western city of Misrata.

One reason Islamic State established itself in Sirte, Waldhauser told the Senate Armed Services Committee, was "to be kind of a backup if Iraq and Syria fail," he said.

Waldhauser estimated that Islamic State faced between 3,000 and 4,000 opponents fighting the group around Sirte, drawn from the Mirsratan militia forces and the Petroleum Facilities Guard Central Branch.

But he cautioned that alliances can shift among the Libyan militia, driven by everything from tribal ties and religious beliefs to material gain.

"The unpredictable nature of paramilitary group patronage will most likely remain a significant obstacle to the GNA’s efforts to establish sovereignty," he said in written testimony.

For months, the United States has had a small number of U.S. forces rotating in and out of Libya, establishing contact with fighters inside the country.

Waldhauser said they were acting in an advisory role to support the unity government, and said no more U.S. troops were needed in the country at this time.

(Reporting by Phil Stewart; Editing by David Gregorio)