警官に

to or at a police officer; marks the officer as the recipient or target of an action., by a police officer

→ 警官
phrase Uncommon #17,218
to or at a police officer; marks the officer as the recipient or target of an action. に shows who an action is directed toward; translate it according to the verb and context.
JA: 男は銃を警官に向けた。
EN: The man pointed a gun at the police officer.

男は銃を警官に向けた。

The man pointed a gun at the police officer.

私は警官に方向を尋ねた。

I asked a police officer for directions.

なぜって――警官に発砲した

Why? Because he shot at a police officer.

— デッド・ドント・ダイ (2019)

奴は俺に銃を向けたんだ警官にだぞ

He pointed a gun at me—the police officer did.

— アメリカン・ギャングスター (2007)

警官に知ってることは全部話しました。

I told the police everything I knew.

私は警官に知っていることを全部話した。

I told the police officer everything I knew.

phrase Rare #35,165
by a police officer In a passive sentence, に marks the police officer who performs the action.
JA: トムは警官に撃たれたんだ。
EN: Tom was shot by a police officer.

警官に聞かれたら大変だ

I'd be in trouble if a police officer asked me.

— RRR (2022)

警官に名前を聞かれた。

A police officer asked me my name.

警官に撃たれたんだよ

I was shot by a police officer.

— レザボア・ドッグス (1992)

彼は警官に連れ去られた。

He was taken away by the police.

トムは警官に撃たれたんだ。

Tom was shot by a police officer.