(Adds objections from board member, other details)

RIO DE JANEIRO, April 12 (Reuters) - Shareholders in Brazil's Petrobras voted on Monday to remove Roberto Castello Branco as CEO, and elected his government-picked successor to the board of directors, but discontent among some investors threatens to drag out the transition process.

The dismissal of Castello Branco, while widely expected, is an important step in the government's plan to place Joaquim Silva e Luna, a retired army general who has no oil and gas experience, in charge of the state-controlled oil producer.

Shareholders also elected eight individuals to the board of directors, one of whom will represent non-government shareholders. The rejigged board has seven members representing the government - the company's majority shareholder -, three representing market investors and one representing Petrobras' workers, the same configuration as the company's previous board.

Three members were not up for re-election and were automatically retained, bringing the total number of board members to 11.

Castello Branco became CEO in January 2019 and drew market plaudits for selling off billions of dollars of non-core assets and sharpening Petrobras' focus on deepwater oil production.

Brazilian President Jair Bolsonaro said in February he was ousting the University of Chicago-educated executive amid a dispute concerning fuel prices. Castello Branco remained on the job in a caretaker role until Monday afternoon.

Bolsonaro picked Luna to take the helm of Petroleo Brasileiro SA, as the firm is formally known. The career soldier is set to be elected chief executive by the new board of directors.

In a securities filing released after the meeting, Petrobras said that Board Chairman Eduardo Leal Ferreira had appointed Carlos Alberto Pereira de Oliveira, the head of the company's upstream division, as interim CEO until Luna's appointment is formalized.

COMPLICATIONS

The evening was not without drama.

At the beginning of the proceedings, Marcelo Gasparino, who was elected to the board as the non-government representative later in the night, called for the meeting to be postponed due to alleged inconsistencies in separate preliminary vote counts published by the company before the meeting.

In a LinkedIn post, he said if he were elected he would later resign, a move that could provoke another shareholders' meeting under Brazilian securities law, effectively starting the board election process from scratch.

The rules governing shareholders' meetings in Brazil can be Byzantine, even when held in-person. Multiple investor groups had complained about the complicated rules governing the Petrobras shareholders' meeting.

The company did not immediately respond to a request for comment on Monday night.

In his post, Gasparino, the freshly elected board member, said he would not resign until after the board elected a new CEO, meaning Luna's formal appointment to the top seat is still likely to happen in a prompt fashion.

Additionally, one of the government-appointed board members, Marcio Weber, was elected even after a Petrobras committee recommended on Friday he not be given a seat on the board on conflict-of-interest grounds as he was an executive until 2020 of a company that provided services to Petrobras.

It was not immediately possible to contact Weber on Monday night.

(Reporting by Gram Slatery and Marta Nogueira; Additional reporting by Sabrina Valle in Rio de Janeiro and Paula Laier in Sao Paulo; Editing by Will Dunham, Peter Cooney and Karishma Singh)