After the Axis invasion of Yugoslavia in April 1941, the Croatian Ustaše regime implemented a policy of widespread incarcerations, massacres, forced emigration and murder of Serbs and other groups, but Đujić escaped to the coastal zone annexed by Italy and began recruiting Chetniks in a refugee camp. When a general uprising began in August, Đujić returned to Knin and employed his Chetniks to defend local Serbs from the Ustaše, and under his command they captured the town of Drvar in the Bosanska Krajina. He then quickly began collaborating with the Italians, gaining their help through signing a non-aggression agreement. At this time, he was still aligned with the insurgency led by the communists. He soon betrayed them and began subverting Partisan units and attacking them alongside the Italians. He formed the Chetnik Dinara Division in early 1942. By mid-1942, Đujić was encouraging his Chetniks to co-operate with NDH forces, and on 1 October Chetniks under his command perpetrated a massacre of nearly 100 Croat civilians in the village of Gata. In early 1943 he attempted to participate on the Axis side in the Case White campaign against the Partisans but this was blocked by the Germans. In August, the Dinara Division suffered significantly at the hands of the Partisans and through desertion. By the time of the Italian capitulation in September it was of little use for offensive operations. When the Germans occupied the area, they restricted it to guarding railway tracks from Partisan sabotage. By November 1943, the Chetnik supreme commander, Draža Mihailović, was ordering Đujić to collaborate with the Germans. In November 1944, Đujić and 4,500 of his Chetniks combined with German and NDH forces in an attempt to defend Knin from the ascendant Partisans. Đujić progressively withdrew his troops until they surrendered to the western Allies in May 1945.