MADRID, Feb 22 (Reuters) - Spain's Repsol raised its dividend by almost 30% on Thursday after its fourth-quarter adjusted profit fell less than expected, as oil and gas prices cooled but the upstream business outperformed forecasts.

Shareholders will get a dividend of 0.90 euros ($0.975) a share for 2023.

Quarterly adjusted profit was 1.20 billion euros, from 2.04 billion euros a year earlier, beating the company-provided average forecast of 1 billion euros.

The Spanish firm will also cancel 40 million shares by the end of July. At Wednesday's closing price, the shares are worth 547 million euros.

($1 = 0.9229 euros) (Reporting by Pietro Lombardi; Editing by David Latona)