Mortgage interest expense

I am going to take out a mortgage out on a primary residence to purchase an investment property.  Can the mortgage interest be an expense on the investment property even though the mortgage isn’t secured by the investment property?