Distribution matching is a fixed-length invertible mapping from a uniformly distributed bit sequence to shaped amplitudes and as such plays an important role in the probabilistic amplitude shaping framework. With conventional constantcomposition distribution matching (CCDM), all output sequences have identical composition. In this paper, we propose partitionbased distribution matching (PBDM) where the composition is constant over all output sequences. When considering the desired distribution as a multiset, PBDM corresponds to partitioning this multiset into equal-size subsets. We show that PBDM allows to address more output sequences and thus has lower rate loss than CCDM in all nontrivial cases. By imposing some constraints on the partitioning, a constructive PBDM algorithm is proposed which comprises two parts. A variable-length prefix of the binary data word determines the composition to be used, and the remainder of the input word is mapped with a conventional CCDM algorithm, such as arithmetic coding, according to the chosen composition. For a specific target distribution and a fixed rate loss, we numerically find that PBDM gives a four-fold reduction in block length in comparison to CCDM. Simulations of 64-ary quadrature amplitude modulation over the additive white Gaussian noise channel demonstrate that the block-length saving of PBDM over CCDM for a fixed gap to capacity varies with the signal-to-noise ratio (SNR) and is approximately a factor of 2.5 to 5 at medium and high SNRs, respectively.