* TSX ends up 0.3% at 21,961.55

* National Bank agrees to buy Canadian Western Bank

* Financials add 0.5%, real estate ends 1% higher

* Technology advances 1.4%

June 12 (Reuters) - Canada's main stock index ended higher on Wednesday as a drop in long-term borrowing costs, following the release of U.S. inflation data, and an acquisition by National Bank of Canada bolstered investor sentiment.

The Toronto Stock Exchange's S&P/TSX composite index ended up 74.21 points, or 0.3%, at 21,961.55, extending the seesaw pattern of recent days.

"Getting some M&A in there, having lower yields, it just feels like it's a little bit more risk-on here," said Greg Taylor, portfolio manager at Purpose Investments. "Banks are up, commodities are doing better with a lower U.S. dollar."

The U.S. currency and bond yields fell after U.S. consumer prices rose less-than-expected in May, raising hopes for a rate cut from the Federal Reserve in the coming months, with the central bank keeping interest rates at current levels in its latest policy statement.

The Bank of Canada has already begun cutting interest rates.

Canadian utility and real estate stocks are likely to be among the biggest beneficiaries of the BoC's easing cycle, while the prospect of increased loan demand could help bank shares, investors say.

Financials added 0.5% after National Bank agreed to a C$5 billion ($3.65 billion) deal to buy Alberta's Canadian Western Bank. Shares of National Bank were down 5.9%, while Canadian Western Bank jumped 68.3%.

Real estate was up 1% and technology ended 1.4% higher.

The price of oil settled 0.8% higher at $78.50 a barrel. Still, energy lost 0.7%.

Consumer discretionary also ended lower, falling 0.5%, with Dollarama shares down 4.1% as the discount store posted lower first-quarter comparable store sales. (Reporting by Fergal Smith in Toronto and Nikhil Sharma and Shristi Achar A; Editing by Shreya Biswas and Alistair Bell)