Under the Masovian dukes the town was developing rapidly lying on the border with Grand Duchy of Lithuania, it became the capital of "ziemia liwska" ('Land of Liw'), a judicial center for the eastern Masovia region, it held a weekly Street market, and three times a year there was a fair there. It was finally incorporated into Crown of the Kingdom of Poland in 1537, upon the settlement between the last princes of Masovia Anna of Masovia and Polish king Sigismund I the Old. Town continued its development and growth into the 17th century, when the wars, Deluge (history) and Great Northern War, brought a physical destruction and a serious decline to the municipality. It lost some of its importance to Węgrów but its final demise was brought by the Partitions of Poland as it was incorporated into the Austrian Partition, the Liw lost its judicial, administrative and economic importance, Austrians dissolved the administrative and territorial unit of "ziemia liwska" and moved the seat of administrative and judicial powers to Siedlce. In 1807 town became part of the Duchy of Warsaw, and already resembled more a large village than a town.