Russian leader Vladimir Putin, despite his public swaggering, has privately signaled support for a settlement in his war with Ukraine that would freeze current battle lines, according to former Russian officials close to the Kremlin and U.S. and international officials who have received Putin’s offers.

After a failed recent counteroffensive and less certain continued U.S. and European assistance, Ukraine should accept negotiations that could require it to give up territory but nevertheless credibly claim victory in the war against Russia.

Understandably, after Putin’s unnecessary and brutal invasion of Ukraine, which has purposefully killed many Ukrainian civilians, President Volodymyr Zelensky and other Ukrainian leaders are still pledging to fight until they regain all their lost territory. Yet, Ukraine’s uncompromising position, which demands that the Russian military withdraw from all Ukrainian land and pay for damages, is untenable.

Even if the war ended today, and existing battle lines became future national boundaries, the magnitude of Ukraine’s victory should not be forgotten. Recent news reports have focused on the failed counteroffensive and the vicissitudes of Western aid. Still, Ukraine, a country much smaller in population and much weaker in military power than invading Russia, not only repulsed the initial Russian attack but has succeeded in clawing back territory in previous counteroffensives in Kherson and the northeast region of Ukraine, after which Putin licked his wounds and made a prior entreaty for a ceasefire in the fall of 2022.

The Ukrainian military has fought tenaciously, and the civilian population has valiantly endured many intentional Russian attacks and depredations that should be deemed war crimes. In short, Ukraine has nothing to be ashamed of.

Instead, Ukraine can be satisfied that it has inflicted severe pain on Putin and Russia—for example, catastrophic casualties, erosion of military capability through destroyed equipment, economic pain and the destabilization of Putin’s rule, as indicated by an aborted coup against his government.

Despite the calm exterior of a former KGB operative, Putin is likely livid at the horrific performance of his generals and vastly overrated military. And in the negotiations, perhaps Ukraine could regain more of its territory.

In the future, Putin, in his created kleptocracy, cannot be sure that, once again, any “much improved” military will be just another shell for corruption and, therefore, incompetence on the battlefield. Even if current battle lines become frozen, Putin, despite his show of arrogance and despite the fears of other Eastern European countries, will likely be deterred by this black eye from using his badly decimated army to invade any NATO country or engage in other substantial mischief anytime soon.

Ukraine is not the first smaller country to best the big Russian bear in a conflict. In 1939, Russia invaded Finland. Like the Ukrainians, the Finns fought hard and effectively to preserve their country from Russia’s larger army. Although Finland had to give up some territory, it prevented Russia from erasing Finland from the map. Today, the world perceives that Finland won the Winter War against Russia. Bearing this out, Finland became a prosperous, non-communist country living in the shadow of an imperially oriented great power.

Ukraine should keep the Finnish example in mind when assessing the costs and benefits of continuing to fight this bitter war. A pragmatic conclusion should question the sensibility of continuing the bloody fight and suffering many more casualties in an unlikely, and even quixotic, effort to regain from a dug-in Russia the Russian-speaking areas of eastern Ukraine, which may well prefer to be in Russia.

A measure to help both countries save face and sell a negotiated settlement to their own publics would be to conduct legitimate, internationally monitored referenda in Crimea and east and southeast Ukraine (unlike Putin’s early sham referenda in those areas) to allow the people there to genuinely determine the country they want to call home.

For Ukraine, the future of continued war looks dismal; the future, if peace is restored, looks much brighter. Ukraine made inroads in being able to start the application process for becoming a member of the European Union—its ticket to future prosperity and becoming part of the West. As it did with Finland after 1940, the world will regard the outcome of this war as an unlikely but courageous victory for Ukraine in preserving its sovereignty against a hostile great power aggressor.

Ending the war rapidly, despite some loss of territory, is the ticket to getting its economy rapidly on the road to prosperity.