at His/Her Majesty's pleasure idiom  law UK specialized      
 留置;坐牢
Someone who is put in prison at His/Her Majesty's pleasure is kept there until it is officially decided that it is safe to release them
  He was declared insane and ordered to be detained in a mental hospital at Her Majesty's pleasure. 他被指患精神病,被拘禁在一个精神医院。