When it is desired to have returned to this state a person charged in this state with a crime, and such person is imprisoned or is held under criminal proceedings then pending against him in another state, the Governor of this state may agree with the executive authority of such other state for the extradition of such person before the conclusion of such proceedings or his term of sentence in such other state, upon condition that such person be returned to such other state at the expense of this state as soon as the prosecution in this state is terminated.
SDCL 23-24-5