Immanuel Kant said this quote

By this freedom the will of a rational being, as belonging to the sensuous world, recognizes itself to be, like all other efficient causes, necessarily subject to the laws of causality, while in practical matters, in its other aspect as a being in itself, it is conscious of its existence as determinable in an intelligible order of things. It is conscious of this not by virtue of a particular intuition of itself but because of certain dynamic laws which determine its causality in the world of sense, for it has been sufficiently proved in another place that if freedom is attributed to us, it transfers us into an intelligible order of things.―from_Critique of Practical Reason_. Translated, with an Introduction by Lewis White Beck, p. 43.