By Jeffrey T. Lewis

SAO PAULO--Brazilian oil giant Petroleo Brasileiro SA, or Petrobras, is taking a series of steps to prepare for increased competition in the South American country's fuels market after the sale of eight of the company's refineries, according to Andre Chiarini, director of trading and logistics.

The sale of the refineries, which the company has said should be finished some time next year, will cut Petrobras's refining capacity in half and leave the company with only five of its own such installations, one in Rio de Janeiro state and four in Sao Paulo state.

Though Brazil's fuels market is already open to competition in the form of imports, with about 17% of diesel fuel sold in the country last year coming from abroad, the sale of the refineries will bring domestic rivals to Petrobras into the picture.

The Rio de Janeiro-based company approved setting up a new logistics department in March to prepare for the new situation, and put Mr. Chiarini in charge.

"We created the department to give more focus to the question of [the new market situation], to deal with greater competition and to guarantee adequate and competitive production," Mr. Chiarini said.

The administration of Brazilian President Jair Bolsonaro has been pushing to open the country's markets up to more competition and reduce state influence in the economy, and state-controlled Petrobras is part of that movement.

The company has been unloading non-core businesses, including selling shallow-water and onshore oil fields and cutting its stake in its service station unit, to focus on increasing production from its rich, deepwater fields off the coast of Rio de Janeiro and Sao Paulo states. The company approved the sale of its remaining stake in the gas station unit earlier this year.

As part of the effort to prepare for more competition in the fuels market, Petrobras has boosted investment in technology to help the company better predict its new competitors' actions, and in training for a new team in the logistics department. Part of the aim of the training is to improve cooperation among different businesses groups and boost employees' competitive spirit, Mr. Chiarini said.

With the company's five remaining refineries located in Sao Paulo and Rio de Janeiro, Petrobras's main focus for its competitive efforts will be in the two states, which are Brazil's most populous and third most populous, and home to the country's two biggest cities.

But Petrobras will still sell fuel in other regions, Mr. Chiarini said. Rio and Sao Paulo are already exporters of refined products to the rest of the country, and the company will monitor the competitive situation in other parts of Brazil and act where it can create value, he said.

"Even after the sale of the refineries, Petrobras will continue to operate in areas where we're competitive, where we have a logistics structure that permits us to be competitive, via cabotage, pipelines" or other forms of transport, Mr. Chiarini said.

New investments in the company's pipeline network, concentrated in its Transpetro unit, and in improving the unit's port terminals, is part of the company's strategy to help keep it competitive in other parts of the country, according to Mr. Chiarini, who declined to provide details on the size of the investment program.

"Transpetro is essential" to the company's plans, he said. "It operates 14,000 kilometers (8700 miles) of pipelines and we intend to continue to use its assets in the best way possible."

Another step Petrobras is taking to ensure it can keep up with competitors in other parts of the country will be regular auctions of refined products, Mr. Chiarini said. The auctions will allow medium-sized distributors in different regions to also be more competitive by giving them the opportunity to buy from Petrobras at a discount

Write to Jeffrey T. Lewis at jeffrey.lewis@wsj.com