Cepsa will create a new entity for the purchase in which investment firm Strategic Resources Global Ltd (SRG) is an investor.

Under the deal, Cepsa will pay C$19 per Coastal Energy share in cash, a premium of 28 percent to the closing price of the stock on Monday on the Toronto Stock Exchange.

"Today's announcement reflects an important step in increasing Cepsa's E&P capabilities. Coastal's business comprises a high-quality portfolio of upstream assets located in Southeast Asia," Cepsa Chief Executive Pedro Miro said in a statement.

The deal, which is expected to close in the first quarter of 2014, will be funded by Cepsa's and SRG's available financial resources.

Coastal Energy is an international exploration and production company with principal assets in Thailand and Malaysia.

(Reporting by Sakthi Prasad in Bangalore; Editing by Gopakumar Warrier)