NEW YORK (Reuters) - Crude futures ended little changed on Friday after signs Greece might have a deal by the weekend to avoid a debt default, while Iran faced continued difficulty in securing an nuclear agreement to end sanctions on its oil exports.
Brent rose modestly after falling for two straight days.
But U.S. crude extended its downside after indications that the country's oil rig count, a measure for future production, may start rising soon.
A suicide bombing by Islamic State militants in Kuwait, which killed 25 people and wounded more than 200, raised fears about the security of Middle East oil supplies and lent some support as well to crude.
Other acts of violence with varying impact on the market included a terror attack in France; the shooting deaths of 28 people in Tunisia, including Western tourists, and the killing of at least 145 civilians in northern Syria by Islamic State militants.
In Greece, Finance Minister Yanis Varoufakis said he saw no reason for his government not to have a deal with its creditors by Saturday as Athens worked toward an agreement that would help it avert a debt default and stay in the euro zone.
A senior EU official said, however, Greece will probably be in arrears with the IMF for a few days.
"If there is a resolution to the Greece problems, this market could get a big boost," said Phil Flynn, analyst at the Price Futures Group in Chicago.
Brent settled up 6 cents, or 0.1 percent, at $63.26 a barrel. For the week, it rose 0.3 percent.
U.S. crude settled down 7 cents, or 0.1 percent, at $59.63. It was down similarly for the week.
Among refined oil products, gasoline rose 0.6 percent while ultra-low sulfur diesel settled flat on short-covering after sharp declines in recent sessions.
In Vienna, ahead of a June 30 deadline for a final deal between Iran and world powers, major differences remained on key issues such as sanctions relief and U.N. access to Iranian nuclear sites, senior Western diplomat said.
On the data front, oil services company Baker Hughes said the U.S. oil rig count, a measure of future production, fell by 3 this week.
It was the smallest drop in five weeks and a sign that the collapse of U.S. drilling was coming to an end, with crude prices recovering after a 60 percent slump between last June and March this year.
"We're bottoming out and should see an end to this drop in the coming weeks," said Matt Smith, director of commodity research at New York-based Clipper Data, referring to the rig count.
Additional reporting by Claire Milhench in London and Keith Wallis in Singapore; Editing by Marguerita Choy, Bernadette Baum and Steve Orlofsky