In 1939, when World War II erupted, Korczak volunteered for duty in the Polish Army, but was refused due to his age.
He witnessed the Wehrmacht takeover of Warsaw.
When the Germans created the Warsaw Ghetto in 1940, his orphanage was forced to move from its building, Dom Sierot at Krochmalna 92, to the Ghetto (first to Chłodna 33 and later to Sienna 16 / Śliska 9).
Korczak moved in with them.
In July, Janusz Korczak decided that the children in the orphanage should put on Rabindranath Tagore's play The Post Office.

On 5 or 6 August 1942, German soldiers came to collect the 192 orphans (there is some debate about the actual number: it may have been 196) and about one dozen staff members to transport them to the Treblinka extermination camp.
Korczak had been offered sanctuary on the "Aryan side" by the Polish underground organization Żegota, but turned it down repeatedly, saying that he could not abandon his children.
On 5 August, he again refused offers of sanctuary, insisting that he would go with the children.

The children were dressed in their best clothes, and each carried a blue knapsack and a favorite book or toy.
Joshua Perle, an eyewitness whose wartime writings were saved in the Ringelblum Archive, described the procession of Korczak and the children through the Ghetto to the Umschlagplatz (deportation point to the death camps):
Janusz Korczak was marching, his head bent forward, holding the hand of a child, without a hat, a leather belt around his waist, and wearing high boots.
A few nurses were followed by two hundred children, dressed in clean and meticulously cared for clothes, as they were being carried to the altar.

— Ghetto eyewitness, Joshua Perle
According to eyewitnesses, when the group of orphans finally reached the Umschlagplatz, an SS officer recognized Korczak as the author of one of his favorite children's books and offered to help him escape.
In another version, the officer was acting officially, as the Nazi authorities had in mind some kind of "special treatment" for Korczak (some prominent Jews with international reputations were sent to Theresienstadt).
Whatever the offer, Korczak once again refused.
He boarded the trains with the children and was never heard from again.
Korczak's evacuation from the Ghetto is also mentioned in Władysław Szpilman's book The Pianist:
He told the orphans they were going out into the country, so they ought to be cheerful.
At last they would be able to exchange the horrible suffocating city walls for meadows of flowers, streams where they could bathe, woods full of berries and mushrooms.
He told them to wear their best clothes, and so they came out into the yard, two by two, nicely dressed and in a happy mood.
The little column was led by an SS man... 
— Władysław Szpilman, The Pianist 
Sometime after, there were rumours that the trains had been diverted and that Korczak and the children had survived.
There was, however, no basis to these stories.
Most likely, Korczak, along with Wilczyńska and most of the children, was killed in a gas chamber upon their arrival at Treblinka.
A separate account of Korczak's departure is given in Mary Berg's Warsaw Ghetto diary:
Dr. Janusz Korczak's children's home is empty now.
A few days ago we all stood at the window and watched the Germans surround the houses.
Rows of children, holding each other by their little hands, began to walk out of the doorway.
There were tiny tots of two or three years among them, while the oldest ones were perhaps thirteen.
Each child carried the little bundle in his hand.

— Mary Berg, The Diary 
There is a cenotaph for him at the Okopowa Street Jewish Cemetery in Warsaw, with a monumental sculpture of Korczak leading his children to the trains.
Created originally by Mieczysław Smorczewski in 1982, the monument was recast in bronze in 2002.
The original was re-erected at the boarding school for children with special needs in Borzęciczki, which is named after Janusz Korczak.
In 1939, when World War II erupted, Korczak volunteered for duty in the Polish Army, but was refused due to his age. He witnessed the Wehrmacht takeover of Warsaw. When the Germans created the Warsaw Ghetto in 1940, his orphanage was forced to move from its building, Dom Sierot at Krochmalna 92, to the Ghetto (first to Chłodna 33 and later to Sienna 16 / Śliska 9). Korczak moved in with them. In July, Janusz Korczak decided that the children in the orphanage should put on Rabindranath Tagore's play The Post Office.
On 5 or 6 August 1942, German soldiers came to collect the 192 orphans (there is some debate about the actual number: it may have been 196) and about one dozen staff members to transport them to the Treblinka extermination camp. Korczak had been offered sanctuary on the "Aryan side" by the Polish underground organization Żegota, but turned it down repeatedly, saying that he could not abandon his children. On 5 August, he again refused offers of sanctuary, insisting that he would go with the children.
The children were dressed in their best clothes, and each carried a blue knapsack and a favorite book or toy. Joshua Perle, an eyewitness whose wartime writings were saved in the Ringelblum Archive, described the procession of Korczak and the children through the Ghetto to the Umschlagplatz (deportation point to the death camps):
Janusz Korczak was marching, his head bent forward, holding the hand of a child, without a hat, a leather belt around his waist, and wearing high boots. A few nurses were followed by two hundred children, dressed in clean and meticulously cared for clothes, as they were being carried to the altar.
— Ghetto eyewitness, Joshua Perle
According to eyewitnesses, when the group of orphans finally reached the Umschlagplatz, an SS officer recognized Korczak as the author of one of his favorite children's books and offered to help him escape. In another version, the officer was acting officially, as the Nazi authorities had in mind some kind of "special treatment" for Korczak (some prominent Jews with international reputations were sent to Theresienstadt). Whatever the offer, Korczak once again refused. He boarded the trains with the children and was never heard from again. Korczak's evacuation from the Ghetto is also mentioned in Władysław Szpilman's book The Pianist:
He told the orphans they were going out into the country, so they ought to be cheerful. At last they would be able to exchange the horrible suffocating city walls for meadows of flowers, streams where they could bathe, woods full of berries and mushrooms. He told them to wear their best clothes, and so they came out into the yard, two by two, nicely dressed and in a happy mood. The little column was led by an SS man... 
— Władysław Szpilman, The Pianist 
Sometime after, there were rumours that the trains had been diverted and that Korczak and the children had survived. There was, however, no basis to these stories. Most likely, Korczak, along with Wilczyńska and most of the children, was killed in a gas chamber upon their arrival at Treblinka. A separate account of Korczak's departure is given in Mary Berg's Warsaw Ghetto diary:
Dr. Janusz Korczak's children's home is empty now. A few days ago we all stood at the window and watched the Germans surround the houses. Rows of children, holding each other by their little hands, began to walk out of the doorway. There were tiny tots of two or three years among them, while the oldest ones were perhaps thirteen. Each child carried the little bundle in his hand. 
— Mary Berg, The Diary 
There is a cenotaph for him at the Okopowa Street Jewish Cemetery in Warsaw, with a monumental sculpture of Korczak leading his children to the trains. Created originally by Mieczysław Smorczewski in 1982, the monument was recast in bronze in 2002. The original was re-erected at the boarding school for children with special needs in Borzęciczki, which is named after Janusz Korczak.
Janusz Korczak