General Wojciech Jaruzelski, who was 90, died at a military hospital in Warsaw after a long illness.
The publicly stern, enigmatic figure still divides Poles today, almost a quarter-century after the fall of communism.
Lech Walesa, who was detained by Mr Jaruzelski as Solidarity leader but eventually succeeded him as president, described the communist as a tragic figure who should be judged only by God.
For many Poles, Mr Jaruzelski was a Soviet stooge who, with Moscow's backing, announced military rule on December 13, 1981 after the first independent trade union behind the Iron Curtain, Solidarity, threatened communist rule.
Others accepted his argument that the decision helped avert a Soviet-led military intervention like those that crushed similar protests in Hungary in 1956 and Czechoslovakia in 1968.
Under martial law, which lasted until 1983, dozens of demonstrators were killed and thousands more, including Mr Walesa, were jailed.
Decades later, on trial for declaring martial law and for human rights violations, Mr Jaruzelski defended his decision. "Martial law was evil but it was a far lesser evil than what would have happened without it," he told a court in 2008, adding that he regretted the "social costs" of the move.
Nobel Peace prize winner Mr Walesa, who succeeded Mr Jaruzelski in 1990, said: "Judging is always hard. We should leave it in God's hands.
"In private talks he was a different man. A joker, he told beautiful jokes, he was at ease, sympathetic, and very intelligent, not at par with his other image. There were two images. A tragic figure, because he lived in times of treason."
A statement from the Medical Institute hospital in Warsaw said: "The general was accompanied by his daughter Monika until the last moment."