(Adds consolidated crude output including subsidiaries, quote)
BOGOTA, July 31 (Reuters) - Colombian state-controlled oil company Ecopetrol's profit fell 18.2 percent in the second quarter from the same period last year due mainly to lower crude output linked to rebel attacks on infrastructure.
Consolidated net profit totaled 2.78 trillion pesos ($1.48 billion) for the April-to-June period, compared with 3.4 trillion pesos in the same period a year ago, its quarterly earnings statement said.
Earnings before interest, taxes, depreciation and amortization, or cash flow, slipped 11.1 percent to 6.68 trillion pesos.
"The variation in profits is explained mainly by lower production due to problems with attacks and blockades by communities that impacted production by about 40,000 barrels a day," Ecopetrol's statement said.
The company said average crude oil output fell 7.4 percent from the same period last year to 561,400 barrels of oil equivalent per day. Production was hampered by the two-month shutdown of a key pipeline attacked by leftist guerrillas.
Gas production totaled 123,500 barrels of oil equivalent per day, down 1.8 percent from the same period of last year. Imports of diesel and gasoline rose due to higher demand.
Consolidated production including all Ecopetrol subsidiaries fell 6.8 percent for crude oil to 600,700 barrels per day while gas output fell 0.2 percent to 133,400 barrels per day equivalent. Output of both combined fell 5.7 percent to 734,100 barrels per day of oil equivalent.
The company will hold a conference call on Tuesday to discuss the results with analysts.
Colombia's oil sector has been hampered by an increase in bomb attacks on pipelines by the Andean nation's left-wing guerrillas. There were 259 attacks last year, the highest in a decade.
An attack on the Cano Limon-Covenas pipeline which shut it down for two months from March 25 and other attacks by leftist guerrillas resulted in a 2 percent reduction in Ecopetrol's revenue in the quarter. A local indigenous community refused to allow Ecopetrol engineers access to the pipeline's damaged stretch, delaying repairs.
Ecopetrol is by far Colombia's biggest oil producer. The largest private sector producer, Toronto-listed Pacific Rubiales, pumps around 320,000 barrels per day.
Ecopetrol's shares have fallen about 16 percent since the start of the year and saw the biggest losses of any stock on Bogota's exchange on Thursday, closing down 0.93 percent at 3,180 pesos.
$1 = 1876.1600 Colombian Pesos Reporting by Peter Murphy; Editing by Mohammad Zargham and Stephen Coates