Yes, both Karma and Our Last Thoughts(or state of mind at point of death, which is also linked to Karma) together, determine where we will be reborn.
The Law of Karma is also the Law of Cause and Effect. Positive actions of body, speech and mind create the cause for happy or fortunate experiences and negative actions create the cause for unhappy experiences and suffering.
Our deluded minds are full of mental afflictions which have been habituated in us over innumerable lifetimes.These propel us towards negative actions all the time.Our actions are constantly and continuously prompted by the three poisons of anger/hatred, desirous attachment and ignorance (that leads us to self grasping.). Thus, unless we practice Dharma and mind transformation and work on these habituated mental afflictions and delusions, we are going to continue engaging in negative actions and reap more negative karma.And at point of death our habituated negative state of mind will present itself, trigger off a negative Throwing Action's imprint which will throw us into a rebirth in the lower realms of suffering.
Not only that, the negative actions will manifest as negative Completing Actions at point of death. A negative Completion Action at point of death will result in an experience of great suffering in our rebirth. Say, for example, that a positive Throwing Action at point of death results in our attaining a human rebirth. But let's say that unfortunately a negative Completing Action manifests at point of death. This will result in our being born in a place where we will experience great suffering, like Somalia.
According to Pabongka Rinpoche in the Lamrim (Liberation in the Palm of Your Hand), we have accumulated an overwhelmingly great amount of negative karma as compared to the relative small amount of positive karma that we have collected. Thus our mind-stream which carries imprints of actions of innumerable previous lifetimes carry much more negative ones than positive ones. So at point of death, there is the greatest likelihood that the imprint of a negative Throwing Action (and the imprint of a negative Completing Action) will be triggered off.
Thus it is imperative that we practice the Dharma via Moral Discipline , Mind Transformation , Guru Devotion, Self-Purification and Accumulation of Merits. THrough Guru Devotion, through carrying out all our Spiritual Guide's instructions to us(he is the assassin of our ego, the root cause of our collecting negative karma and consequent suffering and rebirth in unfortunate realms), we will be able to attain full liberation from suffering and from samsara. We will be be able to attain full Buddhahood. Once we attain Full Buddhahood, we will be beyond Karma and uncontrolled rebirths.