Two teenagers have been charged after allegedly using a stolen vehicle to ram a police car west of Brisbane.

Police say they caught the boys, aged 16 and 17, breaking into a car at Goodna early on Wednesday.

As they pulled their patrol car into a driveway to confront the pair, the boys reversed out, ramming the police vehicle.

The two teenagers tried to flee but were caught.

They've been charged with burglary and unlawful use of a motor vehicle. The driver has also been charged with dangerous driving.

They'll face Ipswich Magistrates Court on Wednesday.