PRAGUE — For a brief moment, it seemed that the powerful adviser’s head might roll at the Castle. After he lost his long legal battle over a hefty state fine, the Czech president warned him to pay up or lose his post.

Then a guardian angel materialized from Moscow.

Lukoil, the largest private Russian oil company in an industry dependent on Kremlin approval, stepped in to pay the nearly $1.4 million fine owed to a Czech court.

The aide, Martin Nejedly, stayed on as economic adviser to the Czech president, Milos Zeman, and vice chairman of his party. Perhaps more important, he retained his office right next to the president’s in the Castle, the official palace that looms over the capital, Prague.

But the payment last spring raised questions about Russian influence-buying in the Castle, where Mr. Zeman has staked out a position as one of the Kremlin’s most ardent sympathizers among European leaders.