A civil or criminal prosecution in a court of a State of the United States against a member of the armed forces of the United States on account of an act done under color of his office or status, or in respect to which he claims any right, title, or authority under a law of the United States respecting the armed forces thereof, or under the law of war, may at any time before the trial or final hearing thereof be removed for trial into the district court of the United States for the district where it is pending in the manner prescribed by law, and it shall thereupon be entered on the docket of the district court, which shall proceed as if the cause had been originally commenced therein and shall have full power to hear and determine the cause.