Exhibit 23.2

​

Graphic

AS-4015-26

​

Consent of Independent Registered Public Accounting Firm

​

We consent to the incorporation by reference in the Registration Statement on (Form F-3 No. 333-278823) of Ecopetrol S.A. of our report dated April 23, 2025, with respect to the consolidated financial statements of Ecopetrol S.A. included in this Annual Report on Form 20-F of Ecopetrol S.A. for the year ended December 31, 2025.

​

​

​

/s/ Ernst & Young S.A.S.

​

Ernst & Young S.A.S.

​

A member of Ernst & Young Global Limited

​

​

​

​

​

Bogotá, Colombia

​

April 30, 2026

​

​