Late in World War II, Hitler charged Himmler with the command of the Army Group Upper Rhine and the Army Group Vistula; he failed to achieve his assigned objectives and Hitler replaced him in these posts. Realising that the war was lost, he attempted to open peace talks with the western Allies without Hitler's knowledge shortly before the war ended. Hearing of this, Hitler dismissed him from all his posts in April 1945 and ordered his arrest. Himmler attempted to go into hiding, but was detained and then arrested by British forces once his identity became known. While in British custody, he committed suicide on 23 May 1945.
Hope this helped :)