* Deal could open up 600,000 bpd of crude exports
* Details of port agreement with rebels unclear
* Eastern federalists want greater share of oil wealth (Adds government meets rebel demand in paragraphs 12-13)
By Ulf Laessing and Ahmed Elumami
TRIPOLI, April 2 (Reuters) - Libya could finalise an agreement in two to three days with rebels to reopen key oil ports, a government spokesman said on Wednesday, bolstering hopes for an end to an eight-month standoff that dried up petroleum revenue.
Brent crude oil prices have fallen sharply since rebel leaders said their group would reach a deal within days to end the blockade of three ports that previously accounted for 600,000 barrels per day of Libyan crude exports.
Any such agreement will help the OPEC member halt its slide into instability. The weak central government seems unable to control militias who helped oust Muammar Gaddafi in 2011 but have kept their guns and made political demands on the state.
But there still appeared a way to go before a full agreement is reached as the rebels put a demand for a referendum for a federalist state on the table even as tribal leaders and officials sought to finalise the deal.
"Negotiations are still ongoing, but we expect an agreement to open the ports," a spokesman for interim Prime Minister Abdullah al-Thinni said, in the first official comment since rebel leader Ibrahim Jathran announced a pact late on Tuesday.
A deal, mediated by tribal elders, could be complete in less than a week, possibly two to three days, the spokesman said.
Movement towards an agreement came after the federalist rebels managed to load oil onto a tanker at one port they control and force it out to sea in an attempt to sell the crude. It was later boarded by U.S. commandos and returned to Libya.
Any talk about introducing a federalist state - devolving some powers and control of oil revenue to regional authorities - like under Gaddafi's predecessor King Idris is sensitive as the government fears it might open the door to secession.
Deep divisions exist between the long-neglected east and the capital Tripoli and richer western cities such as Misrata, compounding Libya's rivalries among tribes, competing political factions and brigades of former rebel militias.
Thinni's spokesman said the deal would focus on compensation for the rebel fighters, who had defected from the state oil security force along with their leader Jathran in the summer when they seized the ports.
A solution would also address the rebel demand to use efficient metering systems to improve monitoring of oil sales and avoid corruption, he said.
In an sign the government is shifting, the cabinet decided to move the headquarters of a state oil protection force to the eastern town of Brega, where Jathran's main office and force is based.
Jathran had been head of the oil force working out of Brega until he defected with thousands of men in the summer. The cabinet also approved financial benefits for some workers in the east, according to a government statement.
Libya's crude output has fallen to around 150,000 bpd from 1.4 million bpd in July when a wave of protests started across the vast north African country, whose proximity to Europe just across the Mediterranean makes it a strategic energy supplier.
Essam al-Jahani, a member of the rebel leadership team, told Reuters the Zueitina ports, the smallest of the three occupied terminals, could reopen within two days if there was a deal.
But he also said the rebels want a referendum for the eastern region on more autonomy, and to move state institutions such as the central bank to the eastern metropolis of Benghazi.
They also still want a share of oil revenue for Cyrenaica, the historic name of their eastern region, to be put in a central bank account in Benghazi.
But Thinni's spokesman said such political goals had been separated from the talks.
"Such large demands are undermining the state or the government," he said.
Apart from the 70,000-bpd Zueitina port, the rebels also control the much larger ports in Ras Lanuf and Es Sider, from where they loaded oil onto the "Morning Glory" tanker before it was captured by the U.S. navy in international waters.
The talks also included a different protest group which has halted exports at the 110,000 bpd Hariga port in the far east, sources told Reuters. This group recently teamed up with Jathran's men, but has disagreed with them in the past.
Analysts say both sides were moving towards a deal since they needed the oil revenue. The lack of oil sales has forced the central bank to burn through some of its reserves to keep the government running, while Jathran had based his rebellion on the ability to sell oil bypassing Tripoli.
A deal, if confirmed, would not necessarily end the shutdown of several oilfields in western Libya by a different set of protesters.
In contrast to the east, protesters at western oil facilities, such as the closed El Sharara field, are divided into small groups with different demands and lack joint leadership with whom Tripoli can bargain. (Reporting by Ulf Laessing, Feras Bosalum and Ahmed Elumami; Editing by Patrick Markey and David Evans)