Two days after the surrender of Japan in August 1945 , nationalist leader , Sukarno , declared independence and became president .
During the Second World War the Dutch lost control and in August 1945 , Sukarno , an influential nationalist leader , declared independence and was appointed president .